Lasawick commited on
Commit
9b1587a
·
verified ·
1 Parent(s): 1959b19

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -0
app.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ pipe = pipeline(
5
+ "text-generation",
6
+ model="mistralai/Mistral-7B-Instruct-v0.1",
7
+ max_new_tokens=256
8
+ )
9
+
10
+ def generate(prompt):
11
+ result = pipe(prompt)
12
+ return result[0]["generated_text"]
13
+
14
+ gr.Interface(
15
+ fn=generate,
16
+ inputs="text",
17
+ outputs="text",
18
+ title="Clawdbot LLM"
19
+ ).launch()