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 lines23242526272627282922 unmodified lines
top_p: 0.2 frequency_penalty: 0 presence_penalty: 0
stream: True
14 unmodified lines151617181920213 unmodified lines2526272829303114 unmodified lines model_name: openai: "gpt-3.5-turbo" azure: "azure/gpt-4" huggingface: "huggingface/meta-llama/Meta-Llama-3-70B-Instruct" # ~~~ generation_parameters ~~ n: 13 unmodified lines top_p: 0.2 frequency_penalty: 0 presence_penalty: 0 stream: False
n_api_retries: 6wait_time_between_retries: 2019 unmodified lines202122232425262728293018 unmodified lines4950515253545556575819 unmodified lines# clear_cache() # Uncomment this line to clear the cache
logging.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=True
dependencies = [ {"url": "aiflows/ChatFlowModule", "revision": os.getcwd()},18 unmodified lines # OpenAI backend api_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