awacke1 commited on
Commit
571c5ec
·
1 Parent(s): 09da7dc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -4
app.py CHANGED
@@ -34,10 +34,17 @@ from templates import bot_template, css, user_template
34
  from xml.etree import ElementTree as ET
35
 
36
  # 1. Constants and Top Level UI Variables
37
- API_URL = 'https://qe55p8afio98s0u3.us-east-1.aws.endpoints.huggingface.cloud' # Dr Llama
 
 
 
 
38
  API_KEY = os.getenv('API_KEY')
 
 
 
39
  headers = {
40
- "Authorization": f"Bearer {API_KEY}",
41
  "Content-Type": "application/json"
42
  }
43
  key = os.getenv('OPENAI_API_KEY')
@@ -444,10 +451,20 @@ def get_zip_download_link(zip_file):
444
  return href
445
 
446
  # 14. Inference Endpoints for Whisper (best fastest STT) on NVIDIA T4 and Llama (best fastest AGI LLM) on NVIDIA A10
 
447
  API_URL_IE = f'https://tonpixzfvq3791u9.us-east-1.aws.endpoints.huggingface.cloud'
 
 
 
 
 
 
 
 
 
448
  headers = {
449
- "Authorization": "Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
450
- "Content-Type": "audio/wav"
451
  }
452
 
453
  @st.cache_resource
 
34
  from xml.etree import ElementTree as ET
35
 
36
  # 1. Constants and Top Level UI Variables
37
+
38
+ # My Inference API Copy
39
+ # API_URL = 'https://qe55p8afio98s0u3.us-east-1.aws.endpoints.huggingface.cloud' # Dr Llama
40
+ # Original:
41
+ API_URL = "https://api-inference.huggingface.co/models/meta-llama/Llama-2-7b-chat-hf"
42
  API_KEY = os.getenv('API_KEY')
43
+ MODEL1="meta-llama/Llama-2-7b-chat-hf"
44
+ MODEL1URL="https://huggingface.co/meta-llama/Llama-2-7b-chat-hf"
45
+ HF_KEY = os.getenv('HF_KEY')
46
  headers = {
47
+ "Authorization": f"Bearer {HF_KEY}",
48
  "Content-Type": "application/json"
49
  }
50
  key = os.getenv('OPENAI_API_KEY')
 
451
  return href
452
 
453
  # 14. Inference Endpoints for Whisper (best fastest STT) on NVIDIA T4 and Llama (best fastest AGI LLM) on NVIDIA A10
454
+ # My Inference Endpoint
455
  API_URL_IE = f'https://tonpixzfvq3791u9.us-east-1.aws.endpoints.huggingface.cloud'
456
+ # Original
457
+ API_URL_IE = "https://api-inference.huggingface.co/models/openai/whisper-small.en"
458
+ MODEL2 = "openai/whisper-small.en"
459
+ MODEL2_URL = "https://huggingface.co/openai/whisper-small.en"
460
+ #headers = {
461
+ # "Authorization": "Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
462
+ # "Content-Type": "audio/wav"
463
+ #}
464
+ HF_KEY = os.getenv('HF_KEY')
465
  headers = {
466
+ "Authorization": f"Bearer {HF_KEY}",
467
+ "Content-Type": "audio/wav"
468
  }
469
 
470
  @st.cache_resource