Spaces:
Running on CPU Upgrade

akhaliq HF staff commited on
Commit
a458c62
·
1 Parent(s): 47d6cc1

add langchain agent

Browse files
Files changed (4) hide show
  1. app.py +3 -1
  2. app_langchain.py +23 -0
  3. pyproject.toml +1 -1
  4. requirements.txt +13 -42
app.py CHANGED
@@ -33,10 +33,12 @@ from app_smolagents import demo as demo_smolagents
33
  from app_groq import demo as demo_groq
34
  from app_groq_coder import demo as demo_groq_coder
35
  from app_openai_coder import demo as demo_openai_coder
 
36
  from utils import get_app
37
 
38
  # Create mapping of providers to their demos
39
  PROVIDERS = {
 
40
  "Gemini Camera": demo_gemini_camera,
41
  "Gemini Coder": demo_gemini_coder,
42
  "OpenAI Coder": demo_openai_coder,
@@ -76,7 +78,7 @@ PROVIDERS = {
76
 
77
  demo = get_app(
78
  models=list(PROVIDERS.keys()),
79
- default_model="Gemini Camera",
80
  src=PROVIDERS,
81
  dropdown_label="Select Provider",
82
  )
 
33
  from app_groq import demo as demo_groq
34
  from app_groq_coder import demo as demo_groq_coder
35
  from app_openai_coder import demo as demo_openai_coder
36
+ from app_langchain import demo as demo_langchain
37
  from utils import get_app
38
 
39
  # Create mapping of providers to their demos
40
  PROVIDERS = {
41
+ "Langchain Agent": demo_langchain,
42
  "Gemini Camera": demo_gemini_camera,
43
  "Gemini Coder": demo_gemini_coder,
44
  "OpenAI Coder": demo_openai_coder,
 
78
 
79
  demo = get_app(
80
  models=list(PROVIDERS.keys()),
81
+ default_model="Langchain Agent",
82
  src=PROVIDERS,
83
  dropdown_label="Select Provider",
84
  )
app_langchain.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import ai_gradio
2
+
3
+ from utils_ai_gradio import get_app
4
+
5
+ # Get the hyperbolic models but keep their full names for loading
6
+ LANGCHAIN_MODELS_FULL = [k for k in ai_gradio.registry.keys() if k.startswith("langchain:")]
7
+
8
+ # Create display names without the prefix
9
+ LANGCHAIN_MODELS_DISPLAY = [k.replace("langchain:", "") for k in LANGCHAIN_MODELS_FULL]
10
+
11
+
12
+ # Create and launch the interface using get_app utility
13
+ demo = get_app(
14
+ models=LANGCHAIN_MODELS_FULL, # Use the full names with prefix
15
+ default_model=LANGCHAIN_MODELS_FULL[0],
16
+ dropdown_label="Select Langchain Model",
17
+ choices=LANGCHAIN_MODELS_DISPLAY, # Display names without prefix
18
+ fill_height=True,
19
+ )
20
+
21
+ if __name__ == "__main__":
22
+ demo.launch()
23
+
pyproject.toml CHANGED
@@ -38,7 +38,7 @@ dependencies = [
38
  "langchain>=0.3.14",
39
  "chromadb>=0.5.23",
40
  "openai>=1.55.0",
41
- "ai-gradio[crewai,deepseek,gemini,groq,hyperbolic,openai,smolagents,transformers]>=0.2.10",
42
  ]
43
 
44
  [tool.uv.sources]
 
38
  "langchain>=0.3.14",
39
  "chromadb>=0.5.23",
40
  "openai>=1.55.0",
41
+ "ai-gradio[crewai,deepseek,gemini,groq,hyperbolic,openai,smolagents,transformers, langchain]>=0.2.13",
42
  ]
43
 
44
  [tool.uv.sources]
requirements.txt CHANGED
@@ -2,7 +2,7 @@
2
  # uv pip compile pyproject.toml -o requirements.txt
3
  accelerate==1.2.1
4
  # via ai-gradio
5
- ai-gradio==0.2.10
6
  # via anychat (pyproject.toml)
7
  aiofiles==23.2.1
8
  # via gradio
@@ -84,7 +84,7 @@ beautifulsoup4==4.12.3
84
  # embedchain
85
  # markdownify
86
  # scrapegraph-py
87
- bitsandbytes==0.45.0
88
  # via ai-gradio
89
  blinker==1.9.0
90
  # via crewai
@@ -232,7 +232,6 @@ filelock==3.16.1
232
  # huggingface-hub
233
  # torch
234
  # transformers
235
- # triton
236
  fireworks-ai==0.15.11
237
  # via fireworks-gradio
238
  fireworks-gradio @ git+https://github.com/AK391/fireworks-ai-gradio.git@5805959ebe511052c417569f056139b4de350a57
@@ -297,7 +296,7 @@ google-crc32c==1.6.0
297
  # aiortc
298
  # google-cloud-storage
299
  # google-resumable-media
300
- google-genai==0.3.0
301
  # via ai-gradio
302
  google-generativeai==0.8.3
303
  # via
@@ -350,8 +349,6 @@ gradio-webrtc==0.0.28
350
  # ai-gradio
351
  # gemini-gradio
352
  # openai-gradio
353
- greenlet==3.1.1
354
- # via sqlalchemy
355
  groq==0.15.0
356
  # via
357
  # ai-gradio
@@ -423,6 +420,7 @@ httpx==0.27.2
423
  # qdrant-client
424
  # replicate
425
  # safehttpx
 
426
  # weaviate-client
427
  httpx-sse==0.4.0
428
  # via
@@ -519,10 +517,12 @@ langchain-cohere==0.3.4
519
  # via embedchain
520
  langchain-community==0.3.14
521
  # via
 
522
  # embedchain
523
  # langchain-experimental
524
  langchain-core==0.3.29
525
  # via
 
526
  # langchain
527
  # langchain-cohere
528
  # langchain-community
@@ -619,7 +619,6 @@ numpy==1.26.4
619
  # via
620
  # accelerate
621
  # ai-gradio
622
- # bitsandbytes
623
  # chroma-hnswlib
624
  # chromadb
625
  # gemini-gradio
@@ -642,39 +641,8 @@ numpy==1.26.4
642
  # soxr
643
  # torchvision
644
  # transformers
645
- nvidia-cublas-cu12==12.1.3.1
646
- # via
647
- # nvidia-cudnn-cu12
648
- # nvidia-cusolver-cu12
649
- # torch
650
- nvidia-cuda-cupti-cu12==12.1.105
651
- # via torch
652
- nvidia-cuda-nvrtc-cu12==12.1.105
653
- # via torch
654
- nvidia-cuda-runtime-cu12==12.1.105
655
- # via torch
656
- nvidia-cudnn-cu12==9.1.0.70
657
- # via torch
658
- nvidia-cufft-cu12==11.0.2.54
659
- # via torch
660
- nvidia-curand-cu12==10.3.2.106
661
- # via torch
662
- nvidia-cusolver-cu12==11.4.5.107
663
- # via torch
664
- nvidia-cusparse-cu12==12.1.0.106
665
- # via
666
- # nvidia-cusolver-cu12
667
- # torch
668
  nvidia-gradio @ git+https://github.com/AK391/nvidia-gradio.git@735cc0ba06afb44eeef789d8c0c35b1fc61fee16
669
  # via anychat (pyproject.toml)
670
- nvidia-nccl-cu12==2.20.5
671
- # via torch
672
- nvidia-nvjitlink-cu12==12.6.85
673
- # via
674
- # nvidia-cusolver-cu12
675
- # nvidia-cusparse-cu12
676
- nvidia-nvtx-cu12==12.1.105
677
- # via torch
678
  oauthlib==3.2.2
679
  # via
680
  # kubernetes
@@ -816,6 +784,8 @@ pillow==11.1.0
816
  # pdfplumber
817
  # smolagents
818
  # torchvision
 
 
819
  platformdirs==4.3.6
820
  # via pooch
821
  playai-gradio @ git+https://github.com/AK391/playai-gradio.git@0958ca289652e231fd12ebbf0f40895a049b0ad1
@@ -1042,6 +1012,7 @@ requests==2.32.3
1042
  # serpapi
1043
  # smolagents
1044
  # spider-client
 
1045
  # tiktoken
1046
  # transformers
1047
  # twilio
@@ -1078,6 +1049,7 @@ scikit-learn==1.6.1
1078
  # via librosa
1079
  scipy==1.15.1
1080
  # via
 
1081
  # librosa
1082
  # scikit-learn
1083
  scrapegraph-py==1.9.0
@@ -1141,6 +1113,8 @@ sympy==1.13.3
1141
  # torch
1142
  tabulate==0.9.0
1143
  # via langchain-cohere
 
 
1144
  tenacity==9.0.0
1145
  # via
1146
  # chromadb
@@ -1156,6 +1130,7 @@ tiktoken==0.7.0
1156
  # embedchain
1157
  # langchain-openai
1158
  # litellm
 
1159
  together-gradio==0.0.1
1160
  # via anychat (pyproject.toml)
1161
  tokenizers==0.20.3
@@ -1177,7 +1152,6 @@ torch==2.4.1
1177
  # via
1178
  # accelerate
1179
  # ai-gradio
1180
- # bitsandbytes
1181
  # torchvision
1182
  torchvision==0.19.1
1183
  # via ai-gradio
@@ -1203,8 +1177,6 @@ trio==0.28.0
1203
  # trio-websocket
1204
  trio-websocket==0.11.1
1205
  # via selenium
1206
- triton==3.0.0
1207
- # via torch
1208
  twilio==9.4.2
1209
  # via
1210
  # anychat (pyproject.toml)
@@ -1224,7 +1196,6 @@ typing-extensions==4.12.2
1224
  # anthropic
1225
  # anyio
1226
  # asgiref
1227
- # bitsandbytes
1228
  # cerebras-cloud-sdk
1229
  # chromadb
1230
  # cohere
 
2
  # uv pip compile pyproject.toml -o requirements.txt
3
  accelerate==1.2.1
4
  # via ai-gradio
5
+ ai-gradio==0.2.13
6
  # via anychat (pyproject.toml)
7
  aiofiles==23.2.1
8
  # via gradio
 
84
  # embedchain
85
  # markdownify
86
  # scrapegraph-py
87
+ bitsandbytes==0.42.0
88
  # via ai-gradio
89
  blinker==1.9.0
90
  # via crewai
 
232
  # huggingface-hub
233
  # torch
234
  # transformers
 
235
  fireworks-ai==0.15.11
236
  # via fireworks-gradio
237
  fireworks-gradio @ git+https://github.com/AK391/fireworks-ai-gradio.git@5805959ebe511052c417569f056139b4de350a57
 
296
  # aiortc
297
  # google-cloud-storage
298
  # google-resumable-media
299
+ google-genai==0.4.0
300
  # via ai-gradio
301
  google-generativeai==0.8.3
302
  # via
 
349
  # ai-gradio
350
  # gemini-gradio
351
  # openai-gradio
 
 
352
  groq==0.15.0
353
  # via
354
  # ai-gradio
 
420
  # qdrant-client
421
  # replicate
422
  # safehttpx
423
+ # tavily-python
424
  # weaviate-client
425
  httpx-sse==0.4.0
426
  # via
 
517
  # via embedchain
518
  langchain-community==0.3.14
519
  # via
520
+ # ai-gradio
521
  # embedchain
522
  # langchain-experimental
523
  langchain-core==0.3.29
524
  # via
525
+ # ai-gradio
526
  # langchain
527
  # langchain-cohere
528
  # langchain-community
 
619
  # via
620
  # accelerate
621
  # ai-gradio
 
622
  # chroma-hnswlib
623
  # chromadb
624
  # gemini-gradio
 
641
  # soxr
642
  # torchvision
643
  # transformers
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
644
  nvidia-gradio @ git+https://github.com/AK391/nvidia-gradio.git@735cc0ba06afb44eeef789d8c0c35b1fc61fee16
645
  # via anychat (pyproject.toml)
 
 
 
 
 
 
 
 
646
  oauthlib==3.2.2
647
  # via
648
  # kubernetes
 
784
  # pdfplumber
785
  # smolagents
786
  # torchvision
787
+ pkgconfig==1.5.5
788
+ # via pyvips
789
  platformdirs==4.3.6
790
  # via pooch
791
  playai-gradio @ git+https://github.com/AK391/playai-gradio.git@0958ca289652e231fd12ebbf0f40895a049b0ad1
 
1012
  # serpapi
1013
  # smolagents
1014
  # spider-client
1015
+ # tavily-python
1016
  # tiktoken
1017
  # transformers
1018
  # twilio
 
1049
  # via librosa
1050
  scipy==1.15.1
1051
  # via
1052
+ # bitsandbytes
1053
  # librosa
1054
  # scikit-learn
1055
  scrapegraph-py==1.9.0
 
1113
  # torch
1114
  tabulate==0.9.0
1115
  # via langchain-cohere
1116
+ tavily-python==0.5.0
1117
+ # via ai-gradio
1118
  tenacity==9.0.0
1119
  # via
1120
  # chromadb
 
1130
  # embedchain
1131
  # langchain-openai
1132
  # litellm
1133
+ # tavily-python
1134
  together-gradio==0.0.1
1135
  # via anychat (pyproject.toml)
1136
  tokenizers==0.20.3
 
1152
  # via
1153
  # accelerate
1154
  # ai-gradio
 
1155
  # torchvision
1156
  torchvision==0.19.1
1157
  # via ai-gradio
 
1177
  # trio-websocket
1178
  trio-websocket==0.11.1
1179
  # via selenium
 
 
1180
  twilio==9.4.2
1181
  # via
1182
  # anychat (pyproject.toml)
 
1196
  # anthropic
1197
  # anyio
1198
  # asgiref
 
1199
  # cerebras-cloud-sdk
1200
  # chromadb
1201
  # cohere