Spaces:
Runtime error
Runtime error
Use the backpack model under stanfordnlp (#2)
Browse files- Use the backpack model under stanfordnlp (5f69038c5250417234deede3b01cfab8c712db27)
Co-authored-by: Lora Xie <lora-x@users.noreply.huggingface.co>
app.py
CHANGED
@@ -6,7 +6,7 @@ import gradio as gr
|
|
6 |
|
7 |
# Build model & get some layers
|
8 |
tokenizer = transformers.AutoTokenizer.from_pretrained('gpt2')
|
9 |
-
m = AutoModelForCausalLM.from_pretrained("
|
10 |
m.eval()
|
11 |
|
12 |
lm_head = m.get_lm_head() # (V, d)
|
|
|
6 |
|
7 |
# Build model & get some layers
|
8 |
tokenizer = transformers.AutoTokenizer.from_pretrained('gpt2')
|
9 |
+
m = AutoModelForCausalLM.from_pretrained("stanfordnlp/backpack-gpt2", trust_remote_code=True)
|
10 |
m.eval()
|
11 |
|
12 |
lm_head = m.get_lm_head() # (V, d)
|