Update app.py
Browse files
app.py
CHANGED
|
@@ -17,14 +17,8 @@ gdown.download('https://drive.usercontent.google.com/download?id=14k2xUrvJ32trhL
|
|
| 17 |
#gdown.download('https://drive.usercontent.google.com/download?id=1dBLgrbtdsByXdtGhwCzWxnYVc8pio9Xb&export=download&confirm=t&uuid=e4f7a2b3-6784-468c-9200-adae1ef988e8', 'message.txt', quiet=False)
|
| 18 |
|
| 19 |
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
with open("data.txt", "r", encoding="utf-8") as f:
|
| 28 |
dataset = f.read()
|
| 29 |
# chars = sorted(list(set(dataset)))
|
| 30 |
chars = ['\t', '\n', ' ', '!', '"', '#', '$', '%', '&', "'", '(', ')', '*', '+', ',', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~', '\x81', '\x8d', '\x8f', '\x90', '\x92', '\x93', '\x94', '\x9d', '\xa0', '¡', '¢', '£', '¤', '¥', '¦', '§', '¨', '©', 'ª', '«', '¬', '\xad', '®', '¯', '°', '±', '²', '³', '´', 'µ', '¶', '·', '¸', '¹', 'º', '»', '¼', '½', '¾', '¿', 'Â', 'Ã', 'Æ', 'Ç', 'É', 'Ê', 'Ë', 'Ð', 'Ò', '×', 'Ø', 'Ù', 'à', 'á', 'â', 'ã', 'ä', 'å', 'é', 'í', 'ï', 'ð', 'ñ', 'ó', 'ö', 'ā', 'Œ', 'œ', 'Š', 'š', 'Ÿ', 'Ž', 'ž', 'ƒ', 'ˆ', '˜', 'і', '\u2005', '\u2009', '\u200a', '\u200b', '\u200e', '–', '—', '―', '‘', '’', '‚', '“', '”', '„', '†', '‡', '•', '…', '\u2028', '\u2029', '\u202a', '‰', '′', '‹', '›', '€', '™', '−', '─', '」', 'fi', '\ufeff', '�', '𝑐', '🌴', '🌹', '🍌', '🙂']
|
|
|
|
| 17 |
#gdown.download('https://drive.usercontent.google.com/download?id=1dBLgrbtdsByXdtGhwCzWxnYVc8pio9Xb&export=download&confirm=t&uuid=e4f7a2b3-6784-468c-9200-adae1ef988e8', 'message.txt', quiet=False)
|
| 18 |
|
| 19 |
|
| 20 |
+
import gzip
|
| 21 |
+
with gzip.open('data.txt.gz', 'rt', encoding='utf-8') as f:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
dataset = f.read()
|
| 23 |
# chars = sorted(list(set(dataset)))
|
| 24 |
chars = ['\t', '\n', ' ', '!', '"', '#', '$', '%', '&', "'", '(', ')', '*', '+', ',', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~', '\x81', '\x8d', '\x8f', '\x90', '\x92', '\x93', '\x94', '\x9d', '\xa0', '¡', '¢', '£', '¤', '¥', '¦', '§', '¨', '©', 'ª', '«', '¬', '\xad', '®', '¯', '°', '±', '²', '³', '´', 'µ', '¶', '·', '¸', '¹', 'º', '»', '¼', '½', '¾', '¿', 'Â', 'Ã', 'Æ', 'Ç', 'É', 'Ê', 'Ë', 'Ð', 'Ò', '×', 'Ø', 'Ù', 'à', 'á', 'â', 'ã', 'ä', 'å', 'é', 'í', 'ï', 'ð', 'ñ', 'ó', 'ö', 'ā', 'Œ', 'œ', 'Š', 'š', 'Ÿ', 'Ž', 'ž', 'ƒ', 'ˆ', '˜', 'і', '\u2005', '\u2009', '\u200a', '\u200b', '\u200e', '–', '—', '―', '‘', '’', '‚', '“', '”', '„', '†', '‡', '•', '…', '\u2028', '\u2029', '\u202a', '‰', '′', '‹', '›', '€', '™', '−', '─', '」', 'fi', '\ufeff', '�', '𝑐', '🌴', '🌹', '🍌', '🙂']
|