Spaces:
No application file
No application file
Update app.py
Browse files
app.py
CHANGED
|
@@ -26,9 +26,9 @@ FastLanguageModel.for_inference(model)
|
|
| 26 |
def predict(question):
|
| 27 |
inputs = tokenizer(
|
| 28 |
[f'''### Question:
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
'''], return_tensors = "pt").to("cuda")
|
| 33 |
|
| 34 |
outputs = model.generate(**inputs, max_new_tokens = 128)
|
|
@@ -39,7 +39,7 @@ def predict(question):
|
|
| 39 |
|
| 40 |
inputs = gr.Textbox(lines=2, label="Enter a question", value="Як отримати виплати ВПО?")
|
| 41 |
|
| 42 |
-
outputs = gr.
|
| 43 |
|
| 44 |
demo = gr.Interface(fn=predict, inputs=inputs, outputs=outputs)
|
| 45 |
demo.launch()
|
|
|
|
| 26 |
def predict(question):
|
| 27 |
inputs = tokenizer(
|
| 28 |
[f'''### Question:
|
| 29 |
+
{question}
|
| 30 |
+
|
| 31 |
+
### Answer:
|
| 32 |
'''], return_tensors = "pt").to("cuda")
|
| 33 |
|
| 34 |
outputs = model.generate(**inputs, max_new_tokens = 128)
|
|
|
|
| 39 |
|
| 40 |
inputs = gr.Textbox(lines=2, label="Enter a question", value="Як отримати виплати ВПО?")
|
| 41 |
|
| 42 |
+
outputs = gr.Markdown(label="Answer")
|
| 43 |
|
| 44 |
demo = gr.Interface(fn=predict, inputs=inputs, outputs=outputs)
|
| 45 |
demo.launch()
|