pp542-0965
commited on
Commit
·
e595409
1
Parent(s):
78768a5
Modify description
Browse files
app.py
CHANGED
@@ -90,26 +90,31 @@ def response(user_schemas, user_question):
|
|
90 |
outputs = model.generate(**inputs, max_new_tokens=1024)
|
91 |
|
92 |
outputs = tokenizer.batch_decode(outputs)
|
93 |
-
output = outputs[0].split("<|im_start|>assistant")[-1]
|
94 |
|
95 |
final_answer = extract_answer(output)
|
96 |
|
97 |
-
|
|
|
|
|
98 |
|
99 |
|
100 |
desc="""
|
101 |
-
Please use the "Table Schemas" field to provide the required schemas to to generate the SQL Query for - separated by new lines
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
|
|
|
|
|
|
113 |
"""
|
114 |
|
115 |
demo = gr.Interface(
|
|
|
90 |
outputs = model.generate(**inputs, max_new_tokens=1024)
|
91 |
|
92 |
outputs = tokenizer.batch_decode(outputs)
|
93 |
+
output = outputs[0].split("<|im_start|>assistant")[-1].strip()
|
94 |
|
95 |
final_answer = extract_answer(output)
|
96 |
|
97 |
+
final_output = output + "\n\n" + "="*20 + "\n\nFinal Answer: \n" + final_answer
|
98 |
+
|
99 |
+
return final_output
|
100 |
|
101 |
|
102 |
desc="""
|
103 |
+
Please use the "Table Schemas" field to provide the required schemas to to generate the SQL Query for - separated by new lines.<br>
|
104 |
+
**Example:**
|
105 |
+
```python
|
106 |
+
CREATE TABLE demographic (
|
107 |
+
subject_id text,
|
108 |
+
admission_type text,
|
109 |
+
hadm_id text)
|
110 |
+
|
111 |
+
CREATE TABLE diagnoses (
|
112 |
+
subject_id text,
|
113 |
+
hadm_id text)
|
114 |
+
```
|
115 |
+
|
116 |
+
Finally, use the "Question" field to provide the relevant question to be answered based on the provided schemas.<br>
|
117 |
+
**Example:** How many patients whose admission type is emergency.
|
118 |
"""
|
119 |
|
120 |
demo = gr.Interface(
|