Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -22,7 +22,7 @@ def preprocess_text(question: str):
|
|
22 |
def classify_text(question: str):
|
23 |
prompt_template = PromptTemplate(template="Answer the following question and classify it: {question}",
|
24 |
input_variables=["question"])
|
25 |
-
format_prompt = prompt_template.format(question=
|
26 |
encoded_input = tokenizer(format_prompt, return_tensors='pt')
|
27 |
# Run the model
|
28 |
output = model.generate(**encoded_input) # Use generate method for text generation
|
|
|
22 |
def classify_text(question: str):
|
23 |
prompt_template = PromptTemplate(template="Answer the following question and classify it: {question}",
|
24 |
input_variables=["question"])
|
25 |
+
format_prompt = prompt_template.format(question=question)
|
26 |
encoded_input = tokenizer(format_prompt, return_tensors='pt')
|
27 |
# Run the model
|
28 |
output = model.generate(**encoded_input) # Use generate method for text generation
|