SunX45 commited on
Commit
d12971c
·
verified ·
1 Parent(s): 4b8b144

Create app.py

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 pipeline
3
+
4
+ def generate_text(prompt):
5
+ pipe = pipeline("text-generation", model="WhiteRabbitNeo/WhiteRabbitNeo-13B-v1")
6
+ generated_text = pipe(prompt, max_length=50)[0]['generated_text']
7
+ return generated_text
8
+
9
+ iface = gr.Interface(
10
+ fn=generate_text,
11
+ inputs="text",
12
+ outputs="text",
13
+ title="WhiteRabbitNeo Text Generation",
14
+ description="Enter a prompt and the AI model will generate text based on it."
15
+ )
16
+
17
+ iface.launch()