Spaces:
Runtime error
Runtime error
traversaal-ai
commited on
Commit
•
8976123
1
Parent(s):
b48da00
Update run.py
Browse files
run.py
CHANGED
@@ -11,6 +11,15 @@ hf_token = os.getenv('hf_token')
|
|
11 |
# Streaming Client
|
12 |
client = InferenceClient(endpoint_url, token=hf_token)
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
def generate_text(prompt):
|
15 |
"""Generates text using the Hugging Face Inference API."""
|
16 |
chat_prompt = f"""
|
|
|
11 |
# Streaming Client
|
12 |
client = InferenceClient(endpoint_url, token=hf_token)
|
13 |
|
14 |
+
gen_kwargs = dict(
|
15 |
+
max_new_tokens=1024,
|
16 |
+
top_k=30,
|
17 |
+
top_p=0.9,
|
18 |
+
temperature=0.2,
|
19 |
+
repetition_penalty=1.05, #1.02
|
20 |
+
stop=["\nUser:", "<|endoftext|>", "</s>"],
|
21 |
+
)
|
22 |
+
|
23 |
def generate_text(prompt):
|
24 |
"""Generates text using the Hugging Face Inference API."""
|
25 |
chat_prompt = f"""
|