Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
import torch
|
2 |
-
from model import
|
3 |
import gradio as gr
|
4 |
|
5 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
6 |
|
7 |
-
model =
|
8 |
model.load_state_dict(torch.load("./neo_gpt.pth", map_location=device))
|
9 |
def generate_text(max_new_tokens):
|
10 |
context = torch.zeros((1, 1), dtype=torch.long)
|
|
|
1 |
import torch
|
2 |
+
from model import BigramLanguageModel, decode
|
3 |
import gradio as gr
|
4 |
|
5 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
6 |
|
7 |
+
model = BigramLanguageModel()
|
8 |
model.load_state_dict(torch.load("./neo_gpt.pth", map_location=device))
|
9 |
def generate_text(max_new_tokens):
|
10 |
context = torch.zeros((1, 1), dtype=torch.long)
|