Chegue100 commited on
Commit
2aa99ab
1 Parent(s): 77f7f04

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -12,17 +12,17 @@ pipe = pipeline("text-generation", model=model, tokenizer=tokenizer, device_map=
12
  def chat(question):
13
  messages = [{"role": "user", "content": question}]
14
  prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True, truncation=True)
15
- outputs = pipe(prompt, max_length=50, truncation=True)[0]
16
  return outputs["generated_text"]
17
 
18
  # Set up the Gradio interface
19
  iface = gr.Interface(
20
  fn=chat,
21
- inputs=gr.Textbox(lines=2, placeholder="Type your question here..."),
22
  outputs="text",
23
- title="Hungarian Chatbot",
24
- description="Ask questions in Hungarian and get answers from the SambaLingo-Hungarian-Chat model."
25
  )
26
 
27
  # Launch the interface
28
- iface.launch(share=True)
 
12
  def chat(question):
13
  messages = [{"role": "user", "content": question}]
14
  prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True, truncation=True)
15
+ outputs = pipe(prompt, max_length=1024, truncation=True)[0]
16
  return outputs["generated_text"]
17
 
18
  # Set up the Gradio interface
19
  iface = gr.Interface(
20
  fn=chat,
21
+ inputs=gr.Textbox(lines=2, placeholder="Kérdezz valamit..."),
22
  outputs="text",
23
+ title="Teszt Chatbot",
24
+ description="SambaLingo-Hungarian-Chat model"
25
  )
26
 
27
  # Launch the interface
28
+ iface.launch()