Spaces:
Sleeping
Sleeping
abhaskumarsinha
commited on
Commit
•
7d113e1
1
Parent(s):
244237e
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@ import gradio as gr
|
|
3 |
# Import necessary modules
|
4 |
from tokenizer.tokenizer import *
|
5 |
from models.GPT import build_GPT
|
6 |
-
from inference.inference import
|
7 |
from inference.sampling_strategies.sample_random import *
|
8 |
|
9 |
# Initialize tokenizer
|
@@ -19,6 +19,9 @@ GPT, flops = build_GPT(256, vocab_size, 1000, 2, 0, 50, 20, 5)
|
|
19 |
# Load pre-trained weights
|
20 |
GPT.load_weights('AEON_30M.weights.h5')
|
21 |
|
|
|
|
|
|
|
22 |
# Default text
|
23 |
default_input_text = "Nearly a half-century ago, Apollo 11 astronaut Neil Armstrong walked on the Moon. NASA is now preparing for an ambitious new era of sustainable human spaceflight and discovery. The agency is building the Space Launch System rocket and the Orion spacecraft for human deep space exploration. With the help of commercial and international partners, NASA will develop new opportunities in lunar orbit, including a platform to aid surface exploration and serve as a gateway to Mars."
|
24 |
|
|
|
3 |
# Import necessary modules
|
4 |
from tokenizer.tokenizer import *
|
5 |
from models.GPT import build_GPT
|
6 |
+
from inference.inference import Generative_inference
|
7 |
from inference.sampling_strategies.sample_random import *
|
8 |
|
9 |
# Initialize tokenizer
|
|
|
19 |
# Load pre-trained weights
|
20 |
GPT.load_weights('AEON_30M.weights.h5')
|
21 |
|
22 |
+
# Inference stance
|
23 |
+
inference = Generative_inference(GPT, tokenizer, input_len=256, k_value=5)
|
24 |
+
|
25 |
# Default text
|
26 |
default_input_text = "Nearly a half-century ago, Apollo 11 astronaut Neil Armstrong walked on the Moon. NASA is now preparing for an ambitious new era of sustainable human spaceflight and discovery. The agency is building the Space Launch System rocket and the Orion spacecraft for human deep space exploration. With the help of commercial and international partners, NASA will develop new opportunities in lunar orbit, including a platform to aid surface exploration and serve as a gateway to Mars."
|
27 |
|