Updated run.py to support Huggingface backend (#2)
Browse files- Updated run.py to support Huggingface backend (18caeb49dcf56f7e563d06c59977723e874efe1a)
- Update run.py (4a87151c31b65b55747982187de61ab8a77a4e8f)
- updated the demo.yaml to support huggingface format (f1b1188c83feeb1d8ac0e457fbc0dbf274f05a3a)
- Parameters not required in huggingflow are removed from yaml file. (504aad133464d08ebf30c31880197d49d9310619)
- Update run.py (ebe17918453b67ca2e547f1f58281ea57023bf30)
Co-authored-by: Neel Shah <Neel-Shah-29@users.noreply.huggingface.co>
Files changed (3)
22 unmodified lines232425262728293022 unmodified linestop_p: 0.2frequency_penalty: 0presence_penalty: 0stream: True22 unmodified lines2324252627282922 unmodified linestop_p: 0.2stream: True
14 unmodified lines1516171819203 unmodified lines24252627282914 unmodified linesmodel_name:openai: "gpt-3.5-turbo"azure: "azure/gpt-4"# ~~~ generation_parameters ~~n: 13 unmodified linestop_p: 0.2frequency_penalty: 0presence_penalty: 0n_api_retries: 6wait_time_between_retries: 2014 unmodified lines151617181920213 unmodified lines2526272829303114 unmodified linesmodel_name:openai: "gpt-3.5-turbo"azure: "azure/gpt-4"huggingface: "huggingface/meta-llama/Meta-Llama-3-70B-Instruct"# ~~~ generation_parameters ~~n: 13 unmodified linestop_p: 0.2frequency_penalty: 0presence_penalty: 0stream: Falsen_api_retries: 6wait_time_between_retries: 20
19 unmodified lines20212223242518 unmodified lines44454647484919 unmodified lines# clear_cache() # Uncomment this line to clear the cachelogging.set_verbosity_debug()dependencies = [{"url": "aiflows/ChatFlowModule", "revision": os.getcwd()},18 unmodified lines# OpenAI backendapi_information = [ApiInfo(backend_used="openai",api_key = os.getenv("OPENAI_API_KEY"))]# # Azure backend# api_information = ApiInfo(backend_used = "azure",# api_base = os.getenv("AZURE_API_BASE"),19 unmodified lines202122232425262728293018 unmodified lines4950515253545556575819 unmodified lines# clear_cache() # Uncomment this line to clear the cachelogging.set_verbosity_debug()# Comment out if using huggingface backend# The set_verbose() method is used for debugging and logging the outputs and drop_params() method automatically drops the parameters which are not set my litellm (since the response format of OpenAI and huggingface is different we require this to translate Huggingface to OpenAI response format).# import litellm# litellm.set_verbose=True# litellm.drop_params=Truedependencies = [{"url": "aiflows/ChatFlowModule", "revision": os.getcwd()},18 unmodified lines# OpenAI backendapi_information = [ApiInfo(backend_used="openai",api_key = os.getenv("OPENAI_API_KEY"))]#Huggingface backend# Here the API_BASE is the api link to your hosted server. By this way, you can run any flows on your own server.# api_information = [ApiInfo(backend_used="huggingface",# api_key = os.getenv("HUGGINGFACE_API_KEY"), api_base="http://0.0.0.0:5000/v1/completions")]# # Azure backend# api_information = ApiInfo(backend_used = "azure",# api_base = os.getenv("AZURE_API_BASE"),
ChatAtomicFlow.yaml+1-2
demo.yaml+2
run.py+9