Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,12 @@
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
from transformers import GPT2Tokenizer, GPT2LMHeadModel
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
# Load the pre-trained GPT-2 model and tokenizer
|
6 |
model_name = "gpt2" # You can change this to another model if needed
|
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
from transformers import GPT2Tokenizer, GPT2LMHeadModel
|
4 |
+
import subprocess
|
5 |
+
|
6 |
+
upgrade_command = "python -m pip install --upgrade pip"
|
7 |
+
|
8 |
+
# Run the command
|
9 |
+
subprocess.run(upgrade_command, shell=True)
|
10 |
|
11 |
# Load the pre-trained GPT-2 model and tokenizer
|
12 |
model_name = "gpt2" # You can change this to another model if needed
|