Upload app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ DEFAULT_MAX_NEW_TOKENS = 1024
|
|
12 |
MAX_INPUT_TOKEN_LENGTH = int(os.getenv("MAX_INPUT_TOKEN_LENGTH", "4096"))
|
13 |
ACCESS_TOKEN = os.getenv("HF_TOKEN", "")
|
14 |
|
15 |
-
model_id = "
|
16 |
model = AutoModelForCausalLM.from_pretrained(
|
17 |
model_id,
|
18 |
torch_dtype=torch.float16,
|
@@ -32,7 +32,7 @@ def generate(
|
|
32 |
system_prompt: str,
|
33 |
max_new_tokens: int = 1024,
|
34 |
temperature: float = 0.01,
|
35 |
-
top_p: float =
|
36 |
) -> Iterator[str]:
|
37 |
conversation = []
|
38 |
if system_prompt:
|
@@ -98,10 +98,10 @@ chat_interface = gr.Interface(
|
|
98 |
minimum=0.05,
|
99 |
maximum=1.0,
|
100 |
step=0.01,
|
101 |
-
value=0
|
102 |
),
|
103 |
],
|
104 |
-
title="Model testing -
|
105 |
description="Provide system settings and a prompt to interact with the model.",
|
106 |
)
|
107 |
|
|
|
12 |
MAX_INPUT_TOKEN_LENGTH = int(os.getenv("MAX_INPUT_TOKEN_LENGTH", "4096"))
|
13 |
ACCESS_TOKEN = os.getenv("HF_TOKEN", "")
|
14 |
|
15 |
+
model_id = "meta-llama/Meta-Llama-3-8B-Instruct"
|
16 |
model = AutoModelForCausalLM.from_pretrained(
|
17 |
model_id,
|
18 |
torch_dtype=torch.float16,
|
|
|
32 |
system_prompt: str,
|
33 |
max_new_tokens: int = 1024,
|
34 |
temperature: float = 0.01,
|
35 |
+
top_p: float = 1.00,
|
36 |
) -> Iterator[str]:
|
37 |
conversation = []
|
38 |
if system_prompt:
|
|
|
98 |
minimum=0.05,
|
99 |
maximum=1.0,
|
100 |
step=0.01,
|
101 |
+
value=1.0,
|
102 |
),
|
103 |
],
|
104 |
+
title="Model testing - Meta-Llama-3-8B-Instruct",
|
105 |
description="Provide system settings and a prompt to interact with the model.",
|
106 |
)
|
107 |
|