Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,23 @@ import subprocess
|
|
3 |
import gradio as gr
|
4 |
from IPython.display import Image, display
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
# Define paths
|
7 |
weights_path = os.path.join('era_v2_assignment_19_model.pt')
|
8 |
|
|
|
3 |
import gradio as gr
|
4 |
from IPython.display import Image, display
|
5 |
|
6 |
+
import torch
|
7 |
+
import torch.nn as nn
|
8 |
+
from torch.nn import functional as F
|
9 |
+
|
10 |
+
# hyperparameters
|
11 |
+
batch_size = 64 # how many independent sequences will we process in parallel?
|
12 |
+
block_size = 256 # what is the maximum context length for predictions?
|
13 |
+
max_iters = 5000
|
14 |
+
eval_interval = 500
|
15 |
+
learning_rate = 3e-4
|
16 |
+
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
17 |
+
eval_iters = 200
|
18 |
+
n_embd = 384
|
19 |
+
n_head = 6
|
20 |
+
n_layer = 6
|
21 |
+
dropout = 0.2
|
22 |
+
|
23 |
# Define paths
|
24 |
weights_path = os.path.join('era_v2_assignment_19_model.pt')
|
25 |
|