Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,10 +8,7 @@ from transformers import AutoTokenizer
|
|
| 8 |
load_dotenv()
|
| 9 |
# Get the Hugging Face API token
|
| 10 |
HUGGINGFACE_TOKEN = os.getenv("HUGGINGFACE_TOKEN")
|
| 11 |
-
|
| 12 |
-
tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-Instruct-v0.3")
|
| 13 |
-
def count_tokens(text):
|
| 14 |
-
return len(tokenizer.encode(text))
|
| 15 |
def summarize_text(text, instructions, agent_name, max_length, temperature, repetition_penalty, top_p):
|
| 16 |
print(f"{agent_name}: Starting summarization")
|
| 17 |
API_URL = "https://api-inference.huggingface.co/models/mistralai/Mistral-7B-Instruct-v0.3"
|
|
|
|
| 8 |
load_dotenv()
|
| 9 |
# Get the Hugging Face API token
|
| 10 |
HUGGINGFACE_TOKEN = os.getenv("HUGGINGFACE_TOKEN")
|
| 11 |
+
|
|
|
|
|
|
|
|
|
|
| 12 |
def summarize_text(text, instructions, agent_name, max_length, temperature, repetition_penalty, top_p):
|
| 13 |
print(f"{agent_name}: Starting summarization")
|
| 14 |
API_URL = "https://api-inference.huggingface.co/models/mistralai/Mistral-7B-Instruct-v0.3"
|