app.py
CHANGED
|
@@ -17,6 +17,7 @@ def score_model(model_uri, databricks_token, data):
|
|
| 17 |
"Content-Type": "application/json",
|
| 18 |
}
|
| 19 |
data_json = json.dumps({"dataframe_split": {"index": [0], "columns": ["prompt", "temperature", "max_tokens"], "data": [[data, 0.5, 500]]}})
|
|
|
|
| 20 |
response = requests.request(method='POST', headers=headers, url=model_uri, json=data_json)
|
| 21 |
if response.status_code != 200:
|
| 22 |
raise Exception(f"Request failed with status {response.status_code}, {response.text}")
|
|
|
|
| 17 |
"Content-Type": "application/json",
|
| 18 |
}
|
| 19 |
data_json = json.dumps({"dataframe_split": {"index": [0], "columns": ["prompt", "temperature", "max_tokens"], "data": [[data, 0.5, 500]]}})
|
| 20 |
+
print(data_json)
|
| 21 |
response = requests.request(method='POST', headers=headers, url=model_uri, json=data_json)
|
| 22 |
if response.status_code != 200:
|
| 23 |
raise Exception(f"Request failed with status {response.status_code}, {response.text}")
|