Spaces:
Sleeping
Sleeping
Commit ·
ee335ff
1
Parent(s): cdbbffa
Updated
Browse files
main.py
CHANGED
|
@@ -20,7 +20,7 @@ from transformers import pipeline
|
|
| 20 |
# CONFIGURATION
|
| 21 |
# ===============================================
|
| 22 |
API_SECRET = "techdisciplesai404"
|
| 23 |
-
MODEL_NAME = "
|
| 24 |
DEVICE = 0 if torch.cuda.is_available() else -1
|
| 25 |
|
| 26 |
# ===============================================
|
|
@@ -42,13 +42,12 @@ try:
|
|
| 42 |
|
| 43 |
|
| 44 |
hf_pipeline = pipeline(
|
| 45 |
-
"
|
| 46 |
model=MODEL_NAME,
|
| 47 |
device=DEVICE,
|
| 48 |
max_new_tokens=1024,
|
| 49 |
-
temperature=0.
|
| 50 |
do_sample=True,
|
| 51 |
-
repetition_penalty=1.2
|
| 52 |
)
|
| 53 |
|
| 54 |
|
|
|
|
| 20 |
# CONFIGURATION
|
| 21 |
# ===============================================
|
| 22 |
API_SECRET = "techdisciplesai404"
|
| 23 |
+
MODEL_NAME = "meta-llama/Llama-2-13b-chat-hf"
|
| 24 |
DEVICE = 0 if torch.cuda.is_available() else -1
|
| 25 |
|
| 26 |
# ===============================================
|
|
|
|
| 42 |
|
| 43 |
|
| 44 |
hf_pipeline = pipeline(
|
| 45 |
+
"text-generation-inference",
|
| 46 |
model=MODEL_NAME,
|
| 47 |
device=DEVICE,
|
| 48 |
max_new_tokens=1024,
|
| 49 |
+
temperature=0.7,
|
| 50 |
do_sample=True,
|
|
|
|
| 51 |
)
|
| 52 |
|
| 53 |
|