Elyad commited on
Commit
212b942
·
verified ·
1 Parent(s): 85ba313

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -1
app.py CHANGED
@@ -19,7 +19,7 @@ def generate_sql(query):
19
  sql_query = tokenizer.decode(outputs[0], skip_special_tokens=True)
20
 
21
  return sql_query
22
-
23
  # Create the Gradio interface
24
  iface = gr.Interface(
25
  fn=generate_sql,
@@ -31,3 +31,27 @@ iface = gr.Interface(
31
 
32
  # Launch the interface
33
  iface.launch(server_port=8080)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  sql_query = tokenizer.decode(outputs[0], skip_special_tokens=True)
20
 
21
  return sql_query
22
+ """
23
  # Create the Gradio interface
24
  iface = gr.Interface(
25
  fn=generate_sql,
 
31
 
32
  # Launch the interface
33
  iface.launch(server_port=8080)
34
+ """
35
+
36
+ """
37
+ For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
38
+ """
39
+ demo = gr.ChatInterface(
40
+ respond,
41
+ additional_inputs=[
42
+ gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
43
+ gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
44
+ gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
45
+ gr.Slider(
46
+ minimum=0.1,
47
+ maximum=1.0,
48
+ value=0.95,
49
+ step=0.05,
50
+ label="Top-p (nucleus sampling)",
51
+ ),
52
+ ],
53
+ )
54
+
55
+
56
+ if __name__ == "__main__":
57
+ demo.launch()