cbspace commited on
Commit ·
edcb083
1
Parent(s): 83b97e5
Fixing error
Browse files
app.py
CHANGED
|
@@ -3,7 +3,6 @@ import tiktoken
|
|
| 3 |
import gradio as gr
|
| 4 |
from safetensors.torch import load_file
|
| 5 |
from huggingface_hub import hf_hub_download
|
| 6 |
-
from model import GPTModel
|
| 7 |
import spaces
|
| 8 |
|
| 9 |
n_layers = 24
|
|
@@ -16,6 +15,7 @@ dropout = 0.0
|
|
| 16 |
|
| 17 |
@spaces.GPU
|
| 18 |
def load_model():
|
|
|
|
| 19 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
| 20 |
tokenizer = tiktoken.encoding_for_model('gpt2')
|
| 21 |
model_path = hf_hub_download('cbspace/gpt', 'model.safetensors')
|
|
|
|
| 3 |
import gradio as gr
|
| 4 |
from safetensors.torch import load_file
|
| 5 |
from huggingface_hub import hf_hub_download
|
|
|
|
| 6 |
import spaces
|
| 7 |
|
| 8 |
n_layers = 24
|
|
|
|
| 15 |
|
| 16 |
@spaces.GPU
|
| 17 |
def load_model():
|
| 18 |
+
from model import GPTModel
|
| 19 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
| 20 |
tokenizer = tiktoken.encoding_for_model('gpt2')
|
| 21 |
model_path = hf_hub_download('cbspace/gpt', 'model.safetensors')
|