Spaces:
Sleeping
Sleeping
Commit
•
62720f5
1
Parent(s):
386be1d
Update app.py
Browse files
app.py
CHANGED
@@ -23,10 +23,10 @@ def respond(encoded_smiles, max_tokens, temperature, top_p, top_k):
|
|
23 |
try:
|
24 |
# Load the Llama model
|
25 |
model_name = "model.gguf"
|
26 |
-
llm = Llama(model_name) #
|
27 |
|
28 |
# Tokenize the input
|
29 |
-
input_ids = llm.tokenize(encoded_smiles) #
|
30 |
|
31 |
# Set generation settings
|
32 |
settings = {
|
@@ -56,10 +56,10 @@ demo = gr.Interface(
|
|
56 |
fn=respond,
|
57 |
inputs=[
|
58 |
gr.Textbox(label="Encoded SMILES"),
|
59 |
-
gr.Slider(minimum=1, maximum=2048,
|
60 |
-
gr.Slider(minimum=0.1, maximum=4.0,
|
61 |
-
gr.Slider(minimum=0.1, maximum=1.0,
|
62 |
-
gr.Slider(minimum=0, maximum=100,
|
63 |
],
|
64 |
outputs=gr.JSON(label="Results"),
|
65 |
theme=gr.themes.Soft(primary_hue="violet", secondary_hue="violet", neutral_hue="gray", font=[gr.themes.GoogleFont("Exo"), "ui-sans-serif", "system-ui", "sans-serif"]).set(
|
|
|
23 |
try:
|
24 |
# Load the Llama model
|
25 |
model_name = "model.gguf"
|
26 |
+
llm = Llama(model_name) # Initialize Llama with the model file
|
27 |
|
28 |
# Tokenize the input
|
29 |
+
input_ids = llm.tokenize(encoded_smiles) # Encode input to token IDs
|
30 |
|
31 |
# Set generation settings
|
32 |
settings = {
|
|
|
56 |
fn=respond,
|
57 |
inputs=[
|
58 |
gr.Textbox(label="Encoded SMILES"),
|
59 |
+
gr.Slider(minimum=1, maximum=2048, step=1, label="Max tokens", default=512),
|
60 |
+
gr.Slider(minimum=0.1, maximum=4.0, step=0.1, label="Temperature", default=1.0),
|
61 |
+
gr.Slider(minimum=0.1, maximum=1.0, step=0.05, label="Top-p", default=1.0),
|
62 |
+
gr.Slider(minimum=0, maximum=100, step=1, label="Top-k", default=50)
|
63 |
],
|
64 |
outputs=gr.JSON(label="Results"),
|
65 |
theme=gr.themes.Soft(primary_hue="violet", secondary_hue="violet", neutral_hue="gray", font=[gr.themes.GoogleFont("Exo"), "ui-sans-serif", "system-ui", "sans-serif"]).set(
|