Spaces:
Build error
Build error
Ronio Jerico Roque commited on
Commit ·
ca0ca71
1
Parent(s): 4f561f7
Fix typos in Conversion Analyst class and improve Amazon class questionnaire handling
Browse files
classes/amazon.py
CHANGED
|
@@ -120,9 +120,7 @@ class Amazon:
|
|
| 120 |
if self.amazon_marketplace_questionnaires != self.template:
|
| 121 |
st.session_state['amazon_marketplace_questionnaires'] = 'uploaded'
|
| 122 |
collect_telemetry(debug_amazon_marketplace_questionnaires)
|
| 123 |
-
print("no")
|
| 124 |
else:
|
| 125 |
-
print("yes")
|
| 126 |
pass
|
| 127 |
|
| 128 |
st.session_state['analyzing'] = False
|
|
|
|
| 120 |
if self.amazon_marketplace_questionnaires != self.template:
|
| 121 |
st.session_state['amazon_marketplace_questionnaires'] = 'uploaded'
|
| 122 |
collect_telemetry(debug_amazon_marketplace_questionnaires)
|
|
|
|
| 123 |
else:
|
|
|
|
| 124 |
pass
|
| 125 |
|
| 126 |
st.session_state['analyzing'] = False
|
classes/response_conversion_analyst.py
CHANGED
|
@@ -31,7 +31,7 @@ class ConversionAnalyst:
|
|
| 31 |
output = response.json()
|
| 32 |
#st.write(output)
|
| 33 |
text = output["outputs"][0]["outputs"][0]["results"]["text"]["data"]["text"]
|
| 34 |
-
|
| 35 |
#st.write(text)
|
| 36 |
return text
|
| 37 |
|
|
@@ -51,13 +51,13 @@ class ConversionAnalyst:
|
|
| 51 |
return x
|
| 52 |
|
| 53 |
def process(self):
|
| 54 |
-
with st.spinner('
|
| 55 |
st.write('')
|
| 56 |
headers = {"Content-Type": "application/json", "x-api-key": f"{os.getenv('x-api-key')}"}
|
| 57 |
try:
|
| 58 |
payload_txt = {"input_value": self.payload, "output_type": "text", "input_type": "chat"}
|
| 59 |
payload_txt_model = self.request_model(payload_txt, headers)
|
| 60 |
-
debug_info = {'data_field' : '
|
| 61 |
upload_response(debug_info)
|
| 62 |
|
| 63 |
count = 0
|
|
|
|
| 31 |
output = response.json()
|
| 32 |
#st.write(output)
|
| 33 |
text = output["outputs"][0]["outputs"][0]["results"]["text"]["data"]["text"]
|
| 34 |
+
text = json.loads(text)
|
| 35 |
#st.write(text)
|
| 36 |
return text
|
| 37 |
|
|
|
|
| 51 |
return x
|
| 52 |
|
| 53 |
def process(self):
|
| 54 |
+
with st.spinner('Conversion Analyst...', show_time=True):
|
| 55 |
st.write('')
|
| 56 |
headers = {"Content-Type": "application/json", "x-api-key": f"{os.getenv('x-api-key')}"}
|
| 57 |
try:
|
| 58 |
payload_txt = {"input_value": self.payload, "output_type": "text", "input_type": "chat"}
|
| 59 |
payload_txt_model = self.request_model(payload_txt, headers)
|
| 60 |
+
debug_info = {'data_field' : 'Conversion Analyst', 'result': payload_txt_model}
|
| 61 |
upload_response(debug_info)
|
| 62 |
|
| 63 |
count = 0
|