invincible-jha commited on
Commit
941cd03
·
verified ·
1 Parent(s): 69cc047

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -8
app.py CHANGED
@@ -13,16 +13,9 @@ import asyncio
13
  logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
14
  logger = logging.getLogger(__name__)
15
 
16
- # Check for Hugging Face API key
17
- if 'HUGGINGFACE_API_KEY' not in os.environ:
18
- logger.error("HUGGINGFACE_API_KEY environment variable is not set.")
19
- logger.info("Please set the HUGGINGFACE_API_KEY environment variable before running this script.")
20
- sys.exit(1)
21
-
22
  # Initialize the client with the Mistral-7B-Instruct-v0.2 model
23
  try:
24
- client = InferenceClient("mistralai/Mistral-7B-Instruct-v0.2",
25
- token=os.environ['HUGGINGFACE_API_KEY'])
26
  except Exception as e:
27
  logger.error(f"Failed to initialize InferenceClient: {e}")
28
  sys.exit(1)
 
13
  logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
14
  logger = logging.getLogger(__name__)
15
 
 
 
 
 
 
 
16
  # Initialize the client with the Mistral-7B-Instruct-v0.2 model
17
  try:
18
+ client = InferenceClient("mistralai/Mistral-7B-Instruct-v0.2")
 
19
  except Exception as e:
20
  logger.error(f"Failed to initialize InferenceClient: {e}")
21
  sys.exit(1)