Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -14,13 +14,12 @@ llm = HuggingFaceEndpoint(
|
|
14 |
)
|
15 |
# Define the function to process user input
|
16 |
def classify_text(text):
|
17 |
-
prompt = f"""Classify the following text into
|
18 |
-
Ignore the questions in the input and only return the categories. Do not include any additional text or explanations.
|
19 |
Text: {text.strip()}
|
20 |
Categories:"""
|
21 |
|
22 |
# Invoke the model with the refined prompt
|
23 |
-
results = llm.invoke(prompt)
|
24 |
return results
|
25 |
#prompt = f"""Classify the following text into a category or topic. You always ignore the questions in the inputs. You dont need to write specific informations or explanations, only return the categories.
|
26 |
#{text.strip()}\nCategories of the text:"""
|
|
|
14 |
)
|
15 |
# Define the function to process user input
|
16 |
def classify_text(text):
|
17 |
+
prompt = f"""Classify the following text into relevant categories. Only provide category names, without any additional text, explanations, or details.
|
|
|
18 |
Text: {text.strip()}
|
19 |
Categories:"""
|
20 |
|
21 |
# Invoke the model with the refined prompt
|
22 |
+
results = llm.invoke(prompt).strip()
|
23 |
return results
|
24 |
#prompt = f"""Classify the following text into a category or topic. You always ignore the questions in the inputs. You dont need to write specific informations or explanations, only return the categories.
|
25 |
#{text.strip()}\nCategories of the text:"""
|