hamaadayubkhan commited on
Commit
ee151ec
1 Parent(s): 3afb9e8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -7
app.py CHANGED
@@ -1,7 +1,6 @@
1
  import gradio as gr
2
  from datasets import load_dataset
3
  import random
4
- import os
5
  import groq # Assuming you are using the Groq library
6
 
7
  # Load dataset
@@ -12,12 +11,8 @@ context = ds["train"]["Context"]
12
  knowledge = ds["train"]["Knowledge"]
13
  response = ds["train"]["Response"]
14
 
15
- # Fetch API key from environment variable
16
- api_key = os.getenv("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")
17
-
18
- # Check if the API key is available
19
- if not api_key:
20
- raise ValueError("Groq API key is missing. Set the environment variable 'GROQ_API_KEY'.")
21
 
22
  # Initialize Groq API client with the API key
23
  client = groq.Client(api_key=api_key)
 
1
  import gradio as gr
2
  from datasets import load_dataset
3
  import random
 
4
  import groq # Assuming you are using the Groq library
5
 
6
  # Load dataset
 
11
  knowledge = ds["train"]["Knowledge"]
12
  response = ds["train"]["Response"]
13
 
14
+ # Directly input the Groq API key (replace with your actual API key)
15
+ api_key = "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"
 
 
 
 
16
 
17
  # Initialize Groq API client with the API key
18
  client = groq.Client(api_key=api_key)