Spaces:
Runtime error
Runtime error
add first application file
Browse files
app.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from transformers import AutoModel, pipeline
|
| 3 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
pipe = pipeline("text-generation", model="meta-llama/Llama-2-7b-chat-hf")
|
| 8 |
+
|
| 9 |
+
# tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-2-7b-chat-hf")
|
| 10 |
+
# model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-2-7b-chat-hf")
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
def greet(name):
|
| 14 |
+
return "Hello " + name + "!!"
|
| 15 |
+
|
| 16 |
+
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 17 |
+
iface.launch()
|