Bhaskar2611 commited on
Commit
fd970b6
·
verified ·
1 Parent(s): 6255a6d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -8,9 +8,9 @@ import pytesseract
8
  from pdf2image import convert_from_path
9
  from huggingface_hub import InferenceClient
10
 
11
- # Initialize Hugging Face Inference Client with a better free model
12
  hf_token = os.getenv("HF_TOKEN")
13
- client = InferenceClient(model="mistralai/Mixtral-8x7B-Instruct-v0.1", token=hf_token)
14
 
15
  def extract_excel_data(file_path):
16
  """Extract text from Excel file"""
@@ -93,11 +93,11 @@ RULES:
93
  """
94
 
95
  try:
96
- # Call LLM with strict parameters
97
  response = client.text_generation(
98
  prompt,
99
  max_new_tokens=2000,
100
- temperature=0.01, # Lower temperature for more deterministic output
101
  stop_sequences=["</s>"]
102
  )
103
  print(f"LLM Response: {response}")
 
8
  from pdf2image import convert_from_path
9
  from huggingface_hub import InferenceClient
10
 
11
+ # Initialize with a reliable free model that supports text-generation
12
  hf_token = os.getenv("HF_TOKEN")
13
+ client = InferenceClient(model="mistralai/Mistral-7B-Instruct-v0.2", token=hf_token)
14
 
15
  def extract_excel_data(file_path):
16
  """Extract text from Excel file"""
 
93
  """
94
 
95
  try:
96
+ # Call LLM via Hugging Face Inference API
97
  response = client.text_generation(
98
  prompt,
99
  max_new_tokens=2000,
100
+ temperature=0.01,
101
  stop_sequences=["</s>"]
102
  )
103
  print(f"LLM Response: {response}")