Spaces:
Runtime error
Runtime error
Commit
·
8dd83e6
1
Parent(s):
b093f2a
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,8 +12,11 @@ def chat(question):
|
|
| 12 |
|
| 13 |
inputs = tokenizer(prompt, return_tensors="pt")
|
| 14 |
output = model.generate(inputs["input_ids"], max_new_tokens=100)
|
| 15 |
-
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
iface = gr.Interface(fn=chat,
|
| 19 |
inputs=gr.inputs.Textbox(label="Enter your text"),
|
|
@@ -21,4 +24,4 @@ iface = gr.Interface(fn=chat,
|
|
| 21 |
title="Chat with Surrey County Council InfoBot")
|
| 22 |
|
| 23 |
# index = construct_index("docs")
|
| 24 |
-
iface.launch()
|
|
|
|
| 12 |
|
| 13 |
inputs = tokenizer(prompt, return_tensors="pt")
|
| 14 |
output = model.generate(inputs["input_ids"], max_new_tokens=100)
|
| 15 |
+
|
| 16 |
+
response = tokenizer.decode(output[0].tolist(), skip_special_tokens=True)
|
| 17 |
+
print(response)
|
| 18 |
+
|
| 19 |
+
return response
|
| 20 |
|
| 21 |
iface = gr.Interface(fn=chat,
|
| 22 |
inputs=gr.inputs.Textbox(label="Enter your text"),
|
|
|
|
| 24 |
title="Chat with Surrey County Council InfoBot")
|
| 25 |
|
| 26 |
# index = construct_index("docs")
|
| 27 |
+
iface.launch()
|