Spaces:
Runtime error
Runtime error
sss
Browse files- llm/inference.py +10 -10
llm/inference.py
CHANGED
|
@@ -69,6 +69,7 @@ def extract_info(text):
|
|
| 69 |
|
| 70 |
|
| 71 |
def get_name(url, object):
|
|
|
|
| 72 |
messages = [
|
| 73 |
{
|
| 74 |
"role": "user",
|
|
@@ -94,19 +95,18 @@ def get_name(url, object):
|
|
| 94 |
)
|
| 95 |
|
| 96 |
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
print(f"Extracting from the output now, function calling")
|
| 103 |
result = extract_product_info(llm_result)
|
| 104 |
-
|
| 105 |
print(f'\n\nThat is the output')
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
|
| 111 |
# url = "https://i.ibb.co/mNYvqDL/crop_39.jpg"
|
| 112 |
# object="fridge"
|
|
|
|
| 69 |
|
| 70 |
|
| 71 |
def get_name(url, object):
|
| 72 |
+
|
| 73 |
messages = [
|
| 74 |
{
|
| 75 |
"role": "user",
|
|
|
|
| 95 |
)
|
| 96 |
|
| 97 |
|
| 98 |
+
print(f'\n\nNow output of LLM:\n')
|
| 99 |
+
llm_result = completion.choices[0].message['content']
|
| 100 |
+
print(llm_result)
|
| 101 |
+
# print(f'\n\nThat is the output')
|
|
|
|
| 102 |
print(f"Extracting from the output now, function calling")
|
| 103 |
result = extract_product_info(llm_result)
|
| 104 |
+
print(f'\n\nResult brand and price:{result}')
|
| 105 |
print(f'\n\nThat is the output')
|
| 106 |
+
# result2 = extract_info(llm_result)
|
| 107 |
+
# print(f'\n\nFrom Google llm:{result2}')
|
| 108 |
+
|
| 109 |
+
return result
|
| 110 |
|
| 111 |
# url = "https://i.ibb.co/mNYvqDL/crop_39.jpg"
|
| 112 |
# object="fridge"
|