Spaces:
Sleeping
Sleeping
Create utils/inference.py
Browse files- utils/inference.py +6 -0
utils/inference.py
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from huggingface_hub import InferenceClient
|
| 2 |
+
|
| 3 |
+
client = InferenceClient("mistralai/Mistral-7B-Instruct-v0.2")
|
| 4 |
+
|
| 5 |
+
def call_model(prompt: str) -> str:
|
| 6 |
+
return client.text_generation(prompt, max_new_tokens=2048, temperature=0.3, return_full_text=False)
|