Spaces:
Runtime error
Runtime error
Rename ImageGPT
Browse files
app.py
CHANGED
@@ -2,7 +2,7 @@ import os
|
|
2 |
os.system('pip install git+https://github.com/huggingface/transformers --upgrade')
|
3 |
|
4 |
import gradio as gr
|
5 |
-
from transformers import ImageGPTFeatureExtractor,
|
6 |
import torch
|
7 |
import numpy as np
|
8 |
import requests
|
@@ -10,7 +10,7 @@ from PIL import Image
|
|
10 |
import matplotlib.pyplot as plt
|
11 |
|
12 |
feature_extractor = ImageGPTFeatureExtractor.from_pretrained("openai/imagegpt-medium")
|
13 |
-
model =
|
14 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
15 |
model.to(device)
|
16 |
|
|
|
2 |
os.system('pip install git+https://github.com/huggingface/transformers --upgrade')
|
3 |
|
4 |
import gradio as gr
|
5 |
+
from transformers import ImageGPTFeatureExtractor, ImageGPTForCausalImageModeling
|
6 |
import torch
|
7 |
import numpy as np
|
8 |
import requests
|
|
|
10 |
import matplotlib.pyplot as plt
|
11 |
|
12 |
feature_extractor = ImageGPTFeatureExtractor.from_pretrained("openai/imagegpt-medium")
|
13 |
+
model = ImageGPTForCausalImageModeling.from_pretrained("openai/imagegpt-medium")
|
14 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
15 |
model.to(device)
|
16 |
|