Hugorowan commited on
Commit
c223b0d
1 Parent(s): d2c91a3

Create GPT1

Browse files
Files changed (1) hide show
  1. GPT1 +16 -0
GPT1 ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import transformers
3
+
4
+ # Load the GPT-2 model
5
+ model = transformers.AutoModelForSequenceClassification.from_pretrained("gpt2-medium")
6
+
7
+ # Create a Gradio interface
8
+ app = gr.Interface(
9
+ inputs=[gr.TextInput(label="Enter text")],
10
+ outputs=[gr.Output(label="Prediction")],
11
+ model=model,
12
+ fn=lambda input: model.predict(input),
13
+ )
14
+
15
+ # Run the app
16
+ app.launch()