Spaces:
Sleeping
Sleeping
Update app.py
#1
by
toantc1024
- opened
app.py
CHANGED
@@ -1,3 +1,16 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
gr.load("models/nhantran0506/law-llms-v1")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
iface = gr.Interface.load("models/nhantran0506/law-llms-v1")
|
4 |
+
|
5 |
+
def wrapper_fn(text, token):
|
6 |
+
# Here, you can use the token as needed.
|
7 |
+
# For example, you might pass it to your model.
|
8 |
+
return iface.predict(text)
|
9 |
+
|
10 |
+
inputs = [
|
11 |
+
gr.inputs.Textbox(lines=2, label="Input Text"),
|
12 |
+
gr.inputs.Textbox(lines=1, label="Token")
|
13 |
+
]
|
14 |
+
|
15 |
+
iface = gr.Interface(fn=wrapper_fn, inputs=inputs, outputs="text")
|
16 |
+
iface.launch(share=True)
|