Updated run.py to support Huggingface backend
Browse files
run.py
CHANGED
@@ -20,7 +20,10 @@ CACHING_PARAMETERS.do_caching = False # Set to True in order to disable caching
|
|
20 |
# clear_cache() # Uncomment this line to clear the cache
|
21 |
|
22 |
logging.set_verbosity_debug()
|
23 |
-
|
|
|
|
|
|
|
24 |
dependencies = [
|
25 |
{"url": "aiflows/ChatFlowModule", "revision": os.getcwd()},
|
26 |
]
|
@@ -44,6 +47,9 @@ if __name__ == "__main__":
|
|
44 |
# OpenAI backend
|
45 |
api_information = [ApiInfo(backend_used="openai",
|
46 |
api_key = os.getenv("OPENAI_API_KEY"))]
|
|
|
|
|
|
|
47 |
# # Azure backend
|
48 |
# api_information = ApiInfo(backend_used = "azure",
|
49 |
# api_base = os.getenv("AZURE_API_BASE"),
|
@@ -100,6 +106,6 @@ if __name__ == "__main__":
|
|
100 |
|
101 |
|
102 |
#9. ~~~~~Optional: Unserve Flow~~~~~~
|
103 |
-
#
|
104 |
|
105 |
|
|
|
20 |
# clear_cache() # Uncomment this line to clear the cache
|
21 |
|
22 |
logging.set_verbosity_debug()
|
23 |
+
# Comment out if using huggingface backend
|
24 |
+
# import litellm
|
25 |
+
# litellm.set_verbose=True
|
26 |
+
# litellm.drop_params=True
|
27 |
dependencies = [
|
28 |
{"url": "aiflows/ChatFlowModule", "revision": os.getcwd()},
|
29 |
]
|
|
|
47 |
# OpenAI backend
|
48 |
api_information = [ApiInfo(backend_used="openai",
|
49 |
api_key = os.getenv("OPENAI_API_KEY"))]
|
50 |
+
#Huggingface backend
|
51 |
+
# api_information = [ApiInfo(backend_used="huggingface",
|
52 |
+
# api_key = os.getenv("HUGGINGFACE_API_KEY"), api_base="http://0.0.0.0:5000/v1/completions")]
|
53 |
# # Azure backend
|
54 |
# api_information = ApiInfo(backend_used = "azure",
|
55 |
# api_base = os.getenv("AZURE_API_BASE"),
|
|
|
106 |
|
107 |
|
108 |
#9. ~~~~~Optional: Unserve Flow~~~~~~
|
109 |
+
# serve_utils.delete_served_flow(cl, "ReverseNumberAtomicFlow_served")
|
110 |
|
111 |
|