ai01firebird commited on
Commit
73f55cc
·
verified ·
1 Parent(s): e03cc76

change to distilgpt2

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -4,8 +4,15 @@ from transformers import AutoTokenizer, AutoModelForCausalLM
4
  import torch
5
 
6
  # Modell und Tokenizer laden
7
- tokenizer = AutoTokenizer.from_pretrained("openai-community/gpt2")
8
- model = AutoModelForCausalLM.from_pretrained("openai-community/gpt2")
 
 
 
 
 
 
 
9
 
10
  def text_to_emoji(text):
11
  # remove special characters
 
4
  import torch
5
 
6
  # Modell und Tokenizer laden
7
+
8
+ # gpt2 outputs text!
9
+ #tokenizer = AutoTokenizer.from_pretrained("openai-community/gpt2")
10
+ #model = AutoModelForCausalLM.from_pretrained("openai-community/gpt2")
11
+
12
+ # distilgpt2 is only 80MB
13
+ tokenizer = AutoTokenizer.from_pretrained("distilgpt2")
14
+ model = AutoModelForCausalLM.from_pretrained("distilgpt2")
15
+
16
 
17
  def text_to_emoji(text):
18
  # remove special characters