update
Browse files
app.py
CHANGED
@@ -14,7 +14,6 @@ MAX_INPUT_TOKEN_LENGTH = int(os.getenv("MAX_INPUT_TOKEN_LENGTH", "4096"))
|
|
14 |
|
15 |
DESCRIPTION = """\
|
16 |
# Hermes-2 Pro 7b Chat
|
17 |
-
This Space demonstrates [Hermes-2 Pro 7b](https://huggingface.co/NousResearch/Hermes-2-Pro-Mistral-7B) by Nous Research, a finetuned Mistral model with 7B parameters for chat instructions.
|
18 |
"""
|
19 |
|
20 |
|
@@ -35,10 +34,10 @@ def generate(
|
|
35 |
chat_history: list[tuple[str, str]],
|
36 |
system_prompt: str,
|
37 |
max_new_tokens: int = 1300,
|
38 |
-
temperature: float = 0.
|
39 |
top_p: float = 0.9,
|
40 |
top_k: int = 50,
|
41 |
-
repetition_penalty: float = 1.
|
42 |
) -> Iterator[str]:
|
43 |
conversation = []
|
44 |
if system_prompt:
|
@@ -117,9 +116,6 @@ chat_interface = gr.ChatInterface(
|
|
117 |
stop_btn=None,
|
118 |
examples=[
|
119 |
["Hello there! How are you doing?"],
|
120 |
-
["Can you explain briefly to me what is the Python programming language?"],
|
121 |
-
["Explain the plot of Cinderella in a sentence."],
|
122 |
-
["How many hours does it take a man to eat a Helicopter?"],
|
123 |
["Write a 100-word article on 'Benefits of Open-Source in AI research'"],
|
124 |
],
|
125 |
)
|
|
|
14 |
|
15 |
DESCRIPTION = """\
|
16 |
# Hermes-2 Pro 7b Chat
|
|
|
17 |
"""
|
18 |
|
19 |
|
|
|
34 |
chat_history: list[tuple[str, str]],
|
35 |
system_prompt: str,
|
36 |
max_new_tokens: int = 1300,
|
37 |
+
temperature: float = 0.9,
|
38 |
top_p: float = 0.9,
|
39 |
top_k: int = 50,
|
40 |
+
repetition_penalty: float = 1.0,
|
41 |
) -> Iterator[str]:
|
42 |
conversation = []
|
43 |
if system_prompt:
|
|
|
116 |
stop_btn=None,
|
117 |
examples=[
|
118 |
["Hello there! How are you doing?"],
|
|
|
|
|
|
|
119 |
["Write a 100-word article on 'Benefits of Open-Source in AI research'"],
|
120 |
],
|
121 |
)
|