HEHEBOIOG commited on
Commit
bcd1cdd
·
verified ·
1 Parent(s): 5dc6d52

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -5
app.py CHANGED
@@ -4,13 +4,13 @@ from huggingface_hub import InferenceClient
4
  from langchain_openai import ChatOpenAI
5
  from crewai_tools import PDFSearchTool
6
  from langchain_community.tools.tavily_search import TavilySearchResults
7
- from crewai_tools import tool
8
  from crewai import Crew, Task, Agent
9
- from google.colab import userdata
10
  from sentence_transformers import SentenceTransformer
11
 
12
- os.environ['GROQ_API_KEY'] = userdata.get('GROQ_API_KEY')
13
- os.environ['TAVILY_API_KEY'] = userdata.get('TAVILY_API_KEY')
 
14
 
15
  client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
16
 
@@ -214,4 +214,15 @@ demo = gr.ChatInterface(
214
  gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
215
  gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
216
  gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
217
- gr.S
 
 
 
 
 
 
 
 
 
 
 
 
4
  from langchain_openai import ChatOpenAI
5
  from crewai_tools import PDFSearchTool
6
  from langchain_community.tools.tavily_search import TavilySearchResults
7
+ from crewai_tools import tool
8
  from crewai import Crew, Task, Agent
 
9
  from sentence_transformers import SentenceTransformer
10
 
11
+ # Set environment variables from Hugging Face secrets
12
+ os.environ['GROQ_API_KEY'] = os.getenv('GROQ_API_KEY')
13
+ os.environ['TAVILY_API_KEY'] = os.getenv('TAVILY_API_KEY')
14
 
15
  client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
16
 
 
214
  gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
215
  gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
216
  gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
217
+ gr.Slider(
218
+ minimum=0.1,
219
+ maximum=1.0,
220
+ value=0.95,
221
+ step=0.05,
222
+ label="Top-p (nucleus sampling)",
223
+ ),
224
+ ],
225
+ )
226
+
227
+ if __name__ == "__main__":
228
+ demo.launch()