kveer001 commited on
Commit
ff79121
1 Parent(s): 5a6c2d0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -1
app.py CHANGED
@@ -1,3 +1,16 @@
1
  import gradio as gr
2
 
3
- gr.load("models/NumbersStation/nsql-llama-2-7B").launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
 
3
+ from transformers import pipeline
4
+
5
+ pipe = pipeline("translation", model="models/NumbersStation/nsql-llama-2-7B")
6
+
7
+ def predict(text):
8
+ return pipe(text)[0]["translation_text"]
9
+
10
+ demo = gr.Interface(
11
+ fn=predict,
12
+ inputs='text',
13
+ outputs='text',
14
+ )
15
+
16
+ demo.launch()