Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -18,15 +18,7 @@ weights_path = hf_hub_download(REPO_ID, "model.safetensors")
|
|
| 18 |
tok_path = hf_hub_download(REPO_ID, "tokenizer.json")
|
| 19 |
|
| 20 |
tok = GlubTokenizer.from_file(tok_path)
|
| 21 |
-
|
| 22 |
-
cfg = ModelConfig(
|
| 23 |
-
vocab_size=tok.vocab_size,
|
| 24 |
-
d_model=448,
|
| 25 |
-
n_layers=8,
|
| 26 |
-
n_heads=7,
|
| 27 |
-
ffn_hidden=896,
|
| 28 |
-
max_seq_len=48,
|
| 29 |
-
)
|
| 30 |
model = GlubLM(cfg)
|
| 31 |
|
| 32 |
state = load_file(weights_path)
|
|
@@ -53,7 +45,7 @@ def chat(prompt: str, temperature: float, top_k: int, top_p: float, max_new_toke
|
|
| 53 |
TAGLINE = "the language model that already forgot this sentence"
|
| 54 |
|
| 55 |
with gr.Blocks(title="GlubLM") as demo:
|
| 56 |
-
gr.Markdown(f"# GlubLM\n> *{TAGLINE}*\n\
|
| 57 |
with gr.Row():
|
| 58 |
with gr.Column():
|
| 59 |
prompt = gr.Textbox(label="say something to the goldfish", value="hello")
|
|
|
|
| 18 |
tok_path = hf_hub_download(REPO_ID, "tokenizer.json")
|
| 19 |
|
| 20 |
tok = GlubTokenizer.from_file(tok_path)
|
| 21 |
+
cfg = ModelConfig(vocab_size=tok.vocab_size)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
model = GlubLM(cfg)
|
| 23 |
|
| 24 |
state = load_file(weights_path)
|
|
|
|
| 45 |
TAGLINE = "the language model that already forgot this sentence"
|
| 46 |
|
| 47 |
with gr.Blocks(title="GlubLM") as demo:
|
| 48 |
+
gr.Markdown(f"# GlubLM\n> *{TAGLINE}*\n\nA 35M-parameter goldfish with a 10-second memory. [Try the Desk Pet](https://den-sec.github.io/glublm/desk-pet/).")
|
| 49 |
with gr.Row():
|
| 50 |
with gr.Column():
|
| 51 |
prompt = gr.Textbox(label="say something to the goldfish", value="hello")
|