Shreyas094 commited on
Commit
f92e80c
·
verified ·
1 Parent(s): c0cb368

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -4
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
- # Initialize the tokenizer
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"