Spaces:
Running
Running
Benjamin Consolvo
commited on
Commit
·
7d9f5c5
1
Parent(s):
5c50a95
patients_file_path syntax error
Browse files- README.md +7 -4
- intelpreventativehealthcare.py +1 -1
README.md
CHANGED
@@ -67,11 +67,14 @@ deactivate
|
|
67 |
### OpenAI API Key, Model Name, and Endpoint URL
|
68 |
|
69 |
|
70 |
-
1.
|
71 |
|
72 |
-
|
73 |
-
|
74 |
-
|
|
|
|
|
|
|
75 |
```json
|
76 |
[
|
77 |
{
|
|
|
67 |
### OpenAI API Key, Model Name, and Endpoint URL
|
68 |
|
69 |
|
70 |
+
1. If using the Hugging Face Spaces app, you can add your OpenAI-compatible API key and the model endpoint URL to the [Hugging Face Settings](https://huggingface.co/spaces/Intel/preventative_healthcare/settings) under "Variables and secrets". They are called by a function called `st.secrets` [here in the app.py code](https://huggingface.co/spaces/Intel/preventative_healthcare/blob/main/app.py#L295).
|
71 |
|
72 |
+
2. If deploying a local version with Streamlit frontend, you can add your details to a file under `.streamlit/secrets.toml` that looks like this:
|
73 |
+
```bash
|
74 |
+
OPENAI_API_KEY = "your-api-key"
|
75 |
+
OPENAI_BASE_URL = "https://api.inference.denvrdata.com/v1/"
|
76 |
+
```
|
77 |
+
3. Finally, if you just want to use the Python script without any Streamlit front-end, you can just add your API key to the [OAI_CONFIG_LIST.json](https://huggingface.co/spaces/Intel/preventative_healthcare/blob/main/OAI_CONFIG_LIST.json) file. Just don't expose your precious API key to the world! You can modify the `api_key`, `model` and `base_url` to the model name and endpoint URL that you are using. This file should look like:
|
78 |
```json
|
79 |
[
|
80 |
{
|
intelpreventativehealthcare.py
CHANGED
@@ -628,7 +628,7 @@ if __name__ == "__main__":
|
|
628 |
|
629 |
# The user proxy agent and data analyst
|
630 |
# will filter the patients based on the criteria defined by the epidemiologist and doctor critic.
|
631 |
-
patients_df, arguments_criteria = asyncio.run(find_patients(criteria,config_list_llama,
|
632 |
|
633 |
# Initialize OpenAI client
|
634 |
openai_client = OpenAI(
|
|
|
628 |
|
629 |
# The user proxy agent and data analyst
|
630 |
# will filter the patients based on the criteria defined by the epidemiologist and doctor critic.
|
631 |
+
patients_df, arguments_criteria = asyncio.run(find_patients(criteria,config_list_llama, patients_file_path=filepath))
|
632 |
|
633 |
# Initialize OpenAI client
|
634 |
openai_client = OpenAI(
|