Yehor commited on
Commit
a4d32a0
·
verified ·
1 Parent(s): c241961

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -26,9 +26,9 @@ FastLanguageModel.for_inference(model)
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,7 +39,7 @@ def predict(question):
39
 
40
  inputs = gr.Textbox(lines=2, label="Enter a question", value="Як отримати виплати ВПО?")
41
 
42
- outputs = gr.Textbox(label="Answer")
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()