llm
Browse files
app.py
CHANGED
|
@@ -1,7 +1,14 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
-
return "Hello " + name + "!!"
|
| 5 |
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
iface.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from transformers import pipeline
|
| 3 |
|
| 4 |
+
generator = pipeline("text-generation", model="AdaptLLM/law-LLM")
|
|
|
|
| 5 |
|
| 6 |
+
def generate(input):
|
| 7 |
+
return generator(
|
| 8 |
+
input,
|
| 9 |
+
max_length=10,
|
| 10 |
+
num_return_sequences=1,
|
| 11 |
+
)
|
| 12 |
+
|
| 13 |
+
iface = gr.Interface(fn=generate, inputs="text", outputs="text")
|
| 14 |
iface.launch()
|