xsa-dev commited on
Commit
637df7e
·
1 Parent(s): 4f3ba5f

add first application file

Browse files
Files changed (1) hide show
  1. app.py +17 -0
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()