Spaces:
Sleeping
Sleeping
Commit
•
afbb139
1
Parent(s):
6b54c98
Update app.py
Browse files
app.py
CHANGED
@@ -10,8 +10,8 @@ tokenizer = AutoTokenizer.from_pretrained(model_id)
|
|
10 |
def chat(question):
|
11 |
prompt = f"### Instruction: {question}\n### Response:"
|
12 |
inputs = tokenizer(prompt, return_tensors="pt")
|
13 |
-
output = model.generate(inputs["input_ids"], max_new_tokens=
|
14 |
-
response = tokenizer.decode(output[0].tolist())
|
15 |
print(response)
|
16 |
return response
|
17 |
|
|
|
10 |
def chat(question):
|
11 |
prompt = f"### Instruction: {question}\n### Response:"
|
12 |
inputs = tokenizer(prompt, return_tensors="pt")
|
13 |
+
output = model.generate(inputs["input_ids"], max_new_tokens=500)
|
14 |
+
response = tokenizer.decode(output[0].tolist(), skip_special_tokens=True)
|
15 |
print(response)
|
16 |
return response
|
17 |
|