Johannes commited on
Commit
2be3343
1 Parent(s): d0e2891
Files changed (1) hide show
  1. app.py +13 -10
app.py CHANGED
@@ -26,22 +26,25 @@ def infer(input_text, model_choice):
26
  return (tokenizer.decode(generated_ids[0], skip_special_tokens=True))
27
 
28
 
 
 
 
 
 
 
 
 
 
 
 
29
  iface = gr.Interface(
30
  title="Text to SQL with NSQL",
31
- description="""The NSQL model family was published by [Numbers Station](https://www.numbersstation.ai/) and is available in three flavors:
32
- - [nsql-6B](https://huggingface.co/NumbersStation/nsql-6B)
33
- - [nsql-2B](https://huggingface.co/NumbersStation/nsql-2B)
34
- - [nsql-350M]((https://huggingface.co/NumbersStation/nsql-350M))
35
- This demo let's you choose which one you want to use and provides the three examples you can also find in their model cards.
36
-
37
- In general you should first provide the table schemas of the tables you have questions about and then prompt it with a natural language question.
38
- The model will then generate a SQL query that you can run against your database.
39
- """,
40
  fn=infer,
41
  inputs=["text",
42
  gr.Dropdown(["nsql-6B", "nsql-2B", "nsql-350M"], value="nsql-6B")],
43
  outputs="text",
44
  examples=[[example1, "nsql-350M"],
45
- [example2, "nsql-350M"],
46
  [example3, "nsql-350M"]])
47
  iface.launch()
 
26
  return (tokenizer.decode(generated_ids[0], skip_special_tokens=True))
27
 
28
 
29
+ description = """The NSQL model family was published by [Numbers Station](https://www.numbersstation.ai/) and is available in three flavors:
30
+ - [nsql-6B](https://huggingface.co/NumbersStation/nsql-6B)
31
+ - [nsql-2B](https://huggingface.co/NumbersStation/nsql-2B)
32
+ - [nsql-350M]((https://huggingface.co/NumbersStation/nsql-350M))
33
+
34
+ This demo let's you choose which one you want to use and provides the three examples you can also find in their model cards.
35
+
36
+ In general you should first provide the table schemas of the tables you have questions about and then prompt it with a natural language question.
37
+ The model will then generate a SQL query that you can run against your database.
38
+ """
39
+
40
  iface = gr.Interface(
41
  title="Text to SQL with NSQL",
42
+ description=description,
 
 
 
 
 
 
 
 
43
  fn=infer,
44
  inputs=["text",
45
  gr.Dropdown(["nsql-6B", "nsql-2B", "nsql-350M"], value="nsql-6B")],
46
  outputs="text",
47
  examples=[[example1, "nsql-350M"],
48
+ [example2, "nsql-2B"],
49
  [example3, "nsql-350M"]])
50
  iface.launch()