Spaces:
Sleeping
Sleeping
Commit
·
1b17d09
1
Parent(s):
029c3bf
add vocab to repo
Browse files
app.py
CHANGED
|
@@ -153,10 +153,10 @@ class GPTLanguageModel(nn.Module):
|
|
| 153 |
index = torch.cat((index, index_next), dim=1) # (B, T+1)
|
| 154 |
return index
|
| 155 |
|
| 156 |
-
if not os.path.exists("./
|
| 157 |
raise Exception("Please run extract.py first")
|
| 158 |
chars = ""
|
| 159 |
-
with open("./
|
| 160 |
text = f.read()
|
| 161 |
chars = sorted(list(set(text)))
|
| 162 |
|
|
|
|
| 153 |
index = torch.cat((index, index_next), dim=1) # (B, T+1)
|
| 154 |
return index
|
| 155 |
|
| 156 |
+
if not os.path.exists("./vocab.txt"):
|
| 157 |
raise Exception("Please run extract.py first")
|
| 158 |
chars = ""
|
| 159 |
+
with open("./vocab.txt", 'r', encoding='utf-8') as f:
|
| 160 |
text = f.read()
|
| 161 |
chars = sorted(list(set(text)))
|
| 162 |
|
vocab.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|