pavan01729 commited on
Commit
f4d8eae
1 Parent(s): 40c4f97

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -1
app.py CHANGED
@@ -1,3 +1,22 @@
1
  import gradio as gr
 
2
 
3
- gr.load("models/pavan01729/llama2_gpt_ai_dataset_plus").launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
+ from transformers import pipeline
3
 
4
+ # Use a smaller, publicly available model
5
+ model_name = "gpt2" # You can change this to another suitable model
6
+
7
+ # Create a text generation pipeline
8
+ generator = pipeline('text-generation', model=model_name)
9
+
10
+ def generate_text(prompt):
11
+ result = generator(prompt, max_length=100, num_return_sequences=1)
12
+ return result[0]['generated_text']
13
+
14
+ iface = gr.Interface(
15
+ fn=generate_text,
16
+ inputs="text",
17
+ outputs="text",
18
+ title="Text Generation with GPT-2",
19
+ description="Enter a prompt to generate text using GPT-2."
20
+ )
21
+
22
+ iface.launch()