Update app.py
Browse files7 unmodified lines8910111213141516177 unmodified linesload_dotenv()# Get the Hugging Face API tokenHUGGINGFACE_TOKEN = os.getenv("HUGGINGFACE_TOKEN")# Initialize the tokenizertokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-Instruct-v0.3")def count_tokens(text):return len(tokenizer.encode(text))def summarize_text(text, instructions, agent_name, max_length, temperature, repetition_penalty, top_p):print(f"{agent_name}: Starting summarization")API_URL = "https://api-inference.huggingface.co/models/mistralai/Mistral-7B-Instruct-v0.3"7 unmodified lines8910111213147 unmodified linesload_dotenv()# Get the Hugging Face API tokenHUGGINGFACE_TOKEN = os.getenv("HUGGINGFACE_TOKEN")def summarize_text(text, instructions, agent_name, max_length, temperature, repetition_penalty, top_p):print(f"{agent_name}: Starting summarization")API_URL = "https://api-inference.huggingface.co/models/mistralai/Mistral-7B-Instruct-v0.3"
app.py+1-4