Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,15 +13,15 @@ client = OpenAI(
|
|
| 13 |
)
|
| 14 |
|
| 15 |
# recording requests to Hugging Face dataset
|
| 16 |
-
DATASET_REPO_URL = "https://huggingface.co/datasets/jadend/mr_bot_requests"
|
| 17 |
-
DATA_FILENAME = "prompt_input.csv"
|
| 18 |
-
DATA_FILE = os.path.join("data", DATA_FILENAME)
|
| 19 |
|
| 20 |
-
HF_TOKEN = os.environ.get("HF_TOKEN")
|
| 21 |
|
| 22 |
-
repo = Repository(
|
| 23 |
-
local_dir="data", clone_from=DATASET_REPO_URL, use_auth_token=HF_TOKEN
|
| 24 |
-
)
|
| 25 |
|
| 26 |
# function to store the message to the Hugging Face site, if you would like to add more columns or information to track add it here
|
| 27 |
def store_message(prompt: str, temperature: str, response: str):
|
|
@@ -52,7 +52,7 @@ def mr_bot(prompt, tokens, temperature):
|
|
| 52 |
max_tokens=tokens,
|
| 53 |
temperature=temperature,
|
| 54 |
)
|
| 55 |
-
store_message(prompt=prompt, temperature=temperature, response=response.choices[0].message.content)
|
| 56 |
|
| 57 |
return response.choices[0].message.content
|
| 58 |
|
|
|
|
| 13 |
)
|
| 14 |
|
| 15 |
# recording requests to Hugging Face dataset
|
| 16 |
+
#DATASET_REPO_URL = "https://huggingface.co/datasets/jadend/mr_bot_requests"
|
| 17 |
+
#DATA_FILENAME = "prompt_input.csv"
|
| 18 |
+
#DATA_FILE = os.path.join("data", DATA_FILENAME)
|
| 19 |
|
| 20 |
+
#HF_TOKEN = os.environ.get("HF_TOKEN")
|
| 21 |
|
| 22 |
+
#repo = Repository(
|
| 23 |
+
# local_dir="data", clone_from=DATASET_REPO_URL, use_auth_token=HF_TOKEN
|
| 24 |
+
#)
|
| 25 |
|
| 26 |
# function to store the message to the Hugging Face site, if you would like to add more columns or information to track add it here
|
| 27 |
def store_message(prompt: str, temperature: str, response: str):
|
|
|
|
| 52 |
max_tokens=tokens,
|
| 53 |
temperature=temperature,
|
| 54 |
)
|
| 55 |
+
# store_message(prompt=prompt, temperature=temperature, response=response.choices[0].message.content)
|
| 56 |
|
| 57 |
return response.choices[0].message.content
|
| 58 |
|