DenSec02 commited on
Commit
e7f52f4
·
verified ·
1 Parent(s): 659202d

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +2 -10
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
- # HF model repo has 18M weights - override defaults to match
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\nAn 18M-parameter goldfish with a 10-second memory. [Try the 35M Desk Pet](https://den-sec.github.io/glublm/desk-pet/).")
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")