Penality commited on
Commit
a5bd9c0
·
verified ·
1 Parent(s): 216a7d6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -9,12 +9,11 @@ from dotenv import load_dotenv
9
  load_dotenv()
10
 
11
  # Set up Together.AI API Key (Replace with your actual key)
12
- together.api_key = os.getenv("TOGETHER_API_KEY")
13
 
14
  def clean_text(text):
15
  """Cleans extracted text for better processing by the model."""
16
  print("cleaning")
17
- print(together.api_key)
18
  text = unicodedata.normalize("NFKC", text) # Normalize Unicode characters
19
  text = re.sub(r'\s+', ' ', text).strip() # Remove extra spaces and newlines
20
  text = re.sub(r'[^a-zA-Z0-9.,!?;:\'\"()\-]', ' ', text) # Keep basic punctuation
 
9
  load_dotenv()
10
 
11
  # Set up Together.AI API Key (Replace with your actual key)
12
+ assert os.getenv("TOGETHER_API_KEY"), "api key missing"
13
 
14
  def clean_text(text):
15
  """Cleans extracted text for better processing by the model."""
16
  print("cleaning")
 
17
  text = unicodedata.normalize("NFKC", text) # Normalize Unicode characters
18
  text = re.sub(r'\s+', ' ', text).strip() # Remove extra spaces and newlines
19
  text = re.sub(r'[^a-zA-Z0-9.,!?;:\'\"()\-]', ' ', text) # Keep basic punctuation