Spaces:
Runtime error
Runtime error
Abhishek Mamdapure
commited on
Commit
·
524def9
1
Parent(s):
041a7ca
Add application file
Browse files
app.py
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from llama_cpp import Llama
|
3 |
+
|
4 |
+
llm = Llama(model_path="decapoda-research/llama-7b-hf")
|
5 |
+
|
6 |
+
def generate_text(input_text):
|
7 |
+
output = llm(input_text, max_tokens=32, stop=["Q:", "\n"], echo=True)
|
8 |
+
return output
|
9 |
+
|
10 |
+
input_text = gr.inputs.Textbox(label="Enter your input text")
|
11 |
+
output_text = gr.outputs.Textbox(label="Output text")
|
12 |
+
|
13 |
+
gr.Interface(fn=generate_text, inputs=input_text, outputs=output_text, title="Llama Language Model", description="Enter your input text to generate output text.").launch()
|