Hodely commited on
Commit
5e5418c
·
verified ·
1 Parent(s): 820a7c7

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+ import gradio as gr
3
+
4
+ pipe = pipeline("text-generation", model="meta-llama/Meta-Llama-3-8B-Instruct")
5
+
6
+ def chat(prompt):
7
+ result = pipe(prompt, max_new_tokens=256, do_sample=True, temperature=0.7)
8
+ return result[0]['generated_text']
9
+
10
+ demo = gr.Interface(fn=chat, inputs="text", outputs="text")
11
+ demo.launch()