Spaces:
Runtime error
Runtime error
shlomihod
commited on
Commit
·
8cf313d
1
Parent(s):
83bde6c
adjust logging levels
Browse files
app.py
CHANGED
@@ -262,7 +262,7 @@ def build_api_call_function(model, hf_token=None, openai_api_key=None):
|
|
262 |
response = await hf_client.text_generation(
|
263 |
prompt, stream=False, details=True, **generation_config
|
264 |
)
|
265 |
-
LOGGER.
|
266 |
|
267 |
length = len(response.details.prefill) + len(response.details.tokens)
|
268 |
|
@@ -380,7 +380,7 @@ async def complete(api_call_function, prompt, generation_config=None):
|
|
380 |
if generation_config is None:
|
381 |
generation_config = {}
|
382 |
|
383 |
-
LOGGER.
|
384 |
|
385 |
output, length = await api_call_function(prompt, generation_config)
|
386 |
|
@@ -446,8 +446,8 @@ def canonize_label(output, annotation_labels, search_row):
|
|
446 |
def measure(dataset, outputs, labels, label_column, input_columns, search_row):
|
447 |
inferences = [canonize_label(output, labels, search_row) for output in outputs]
|
448 |
|
449 |
-
LOGGER.
|
450 |
-
LOGGER.
|
451 |
inference_labels = labels + [UNKNOWN_LABEL]
|
452 |
|
453 |
evaluation_df = pd.DataFrame(
|
@@ -704,9 +704,9 @@ def main():
|
|
704 |
for split in splits_df:
|
705 |
st.session_state[f"{split}_dataset"] = splits_df[split]
|
706 |
|
707 |
-
LOGGER.
|
708 |
-
LOGGER.
|
709 |
-
LOGGER.
|
710 |
|
711 |
with st.expander("Info"):
|
712 |
try:
|
@@ -823,5 +823,5 @@ def main():
|
|
823 |
|
824 |
|
825 |
if __name__ == "__main__":
|
826 |
-
logging.basicConfig(level=logging.
|
827 |
main()
|
|
|
262 |
response = await hf_client.text_generation(
|
263 |
prompt, stream=False, details=True, **generation_config
|
264 |
)
|
265 |
+
LOGGER.info(response)
|
266 |
|
267 |
length = len(response.details.prefill) + len(response.details.tokens)
|
268 |
|
|
|
380 |
if generation_config is None:
|
381 |
generation_config = {}
|
382 |
|
383 |
+
LOGGER.info(f"API Call\n\n``{prompt}``\n\n{generation_config=}")
|
384 |
|
385 |
output, length = await api_call_function(prompt, generation_config)
|
386 |
|
|
|
446 |
def measure(dataset, outputs, labels, label_column, input_columns, search_row):
|
447 |
inferences = [canonize_label(output, labels, search_row) for output in outputs]
|
448 |
|
449 |
+
LOGGER.info(f"{inferences=}")
|
450 |
+
LOGGER.info(f"{labels=}")
|
451 |
inference_labels = labels + [UNKNOWN_LABEL]
|
452 |
|
453 |
evaluation_df = pd.DataFrame(
|
|
|
704 |
for split in splits_df:
|
705 |
st.session_state[f"{split}_dataset"] = splits_df[split]
|
706 |
|
707 |
+
LOGGER.info(f"FORM {dataset=}")
|
708 |
+
LOGGER.info(f"FORM {model=}")
|
709 |
+
LOGGER.info(f"FORM {generation_config=}")
|
710 |
|
711 |
with st.expander("Info"):
|
712 |
try:
|
|
|
823 |
|
824 |
|
825 |
if __name__ == "__main__":
|
826 |
+
logging.basicConfig(level=logging.DEBUG)
|
827 |
main()
|