Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -36,7 +36,6 @@ st.set_page_config(
|
|
36 |
# chunks.append(current.strip())
|
37 |
# return chunks
|
38 |
|
39 |
-
# Save text to image
|
40 |
def save_text_as_image(text, file_path):
|
41 |
font = ImageFont.load_default()
|
42 |
lines = text.split('\n')
|
@@ -128,22 +127,22 @@ if uploaded_file:
|
|
128 |
|
129 |
prompt = PromptTemplate(input_variables=["prescription_text"], template=template)
|
130 |
|
131 |
-
|
132 |
repo_id="aaditya/Llama3-OpenBioLLM-70B",
|
133 |
provider="nebius",
|
134 |
temperature=0.6,
|
135 |
max_new_tokens=300,
|
136 |
-
task="
|
137 |
)
|
138 |
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
|
148 |
chain = LLMChain(llm=llm, prompt=prompt)
|
149 |
|
|
|
36 |
# chunks.append(current.strip())
|
37 |
# return chunks
|
38 |
|
|
|
39 |
def save_text_as_image(text, file_path):
|
40 |
font = ImageFont.load_default()
|
41 |
lines = text.split('\n')
|
|
|
127 |
|
128 |
prompt = PromptTemplate(input_variables=["prescription_text"], template=template)
|
129 |
|
130 |
+
llm_model = HuggingFaceEndpoint(
|
131 |
repo_id="aaditya/Llama3-OpenBioLLM-70B",
|
132 |
provider="nebius",
|
133 |
temperature=0.6,
|
134 |
max_new_tokens=300,
|
135 |
+
task="conversational"
|
136 |
)
|
137 |
|
138 |
+
llm = ChatHuggingFace(
|
139 |
+
llm=llm_model,
|
140 |
+
repo_id="aaditya/Llama3-OpenBioLLM-70B",
|
141 |
+
provider="nebius",
|
142 |
+
temperature=0.6,
|
143 |
+
max_new_tokens=300,
|
144 |
+
task="conversational"
|
145 |
+
)
|
146 |
|
147 |
chain = LLMChain(llm=llm, prompt=prompt)
|
148 |
|