Spaces:
Runtime error
Runtime error
Jyotiyadav
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -31,8 +31,7 @@ def generate_output(prompt,max_new_tokens, temperature, top_k, top_p, model):
|
|
31 |
return result[0]['generated_text']
|
32 |
|
33 |
|
34 |
-
examples = [['''Your task is to extract the information corresponding to the provided labels from the below given email.###Instruction:*pickup_location: Street address of the origin location of goods.*pickup_cap: Postal code or ZIP code of the pickup location.*pickup_port: Port of pickup, often used in international shipping.*pickup_state: Only Country of pickup location.*delivery_location: Street address of the destination location of goods.*delivery_cap: Postal code or ZIP code of delivery location.*delivery_port: Port of delivery, similar to pickup port.*delivery_state: State or region of delivery location.*total_quantity: Overall quantity of shipped items (e.g., pieces, boxes). Calculate the total_quantity by summing the quantity of all packages.*total_weight: Total weight of the shipment (e.g., kg, lbs). Calculate the total_weight by summing the weights of all packages.*total_volume: Total volume of the shipment (e.g., cubic meters, cubic feet). Calculate the total_volume by summing the volumes of all packages.*quantity: Individual Quantity of a specific item being shipped.*package_type: Individual Type of packaging used (e.g., pallets, cartons).*weight: Individual Weight of a specific package.*measures: Individual Dimensions or measurements of a package.*stackable: Indicates whether the shipment is stackable (True or False).*volume: Individual Volume of a specific package.*commodity: Type of goods or commodities being shipped.*company: Name of the email sending company, also the shipping company or carrier.*incoterms: Choose available options: EXW, FCA, FAS, FOB, CFR, CIF, CPT, CIP, DAP, DPU, DDP.For attributes with multiple values, such as measures, volume, weight, package_type, and quantity, provide each value separately in a JSON format.###Input:dubaiDear Team,;Please quote SEA option for below inquiry;POD :Jebel Ali .;estimated packing details;3300x950x1350 mm;3800x1700x1350 mm;1900x2000x1200 mm;1900x2000x1200 mm;2600x1300x1200 mm;3900x1100x1350 mm;820x780x950 mm;Total weight kg 5000 approx;Not stackable;Marrone Srl;via Rui, 5 - Loc. Prà dei Risi;I - 33080 Zoppola (PN);Warehouse: 08:00 – 12:00 / 13:00 – 16:30;Warehouse Handling + Free days w.e.f 01-01-2024;AED 250 + vat until 10 CBM - AED 350 + Vat 11 CBM on wards;Free time applicable - 7 days only for General cargo from DO readiness & No free time for HAZ CARGO, post which standard storage tariff will apply.;Important Notice;:Considering the ongoing circumstances, please be informed after booking confirmation the rates and schedules may undergo changes without advance notice.;Please also expect vessel delays and changes in transit time.;CSS will not be liable for any claims that arise due to this.;Deepak Unnikrishnan;Sr Sales Coordinator;Consolidated Shipping Service L.L.C.;Office: +971 4 883 1303 | Ext: 1163| Toll Free: 800277 | Mobile: +971501513697|;Dubai | United Arab Emirates;nvo-import5@cssdubai.com | www.cssgroupsite.com;Our Offices: Dubai | Abu Dhabi | Sharjah | Ras-Al-Khaimah | Bahrain | Oman | Qatar | Saudi Arabia | Kuwait | Iraq | Africa | Turkiye | India | Sri Lanka |;Disclaimer: This email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please delete all copies and notify the sender immediately.;Please read our;disclaimer.###Response:''']
|
35 |
-
['''Your task is to extract the information corresponding to the provided labels from the below given email.###Instruction:*pickup_location: Street address of the origin location of goods.*pickup_cap: Postal code or ZIP code of the pickup location.*pickup_port: Port of pickup, often used in international shipping.*pickup_state: Only Country of pickup location.*delivery_location: Street address of the destination location of goods.*delivery_cap: Postal code or ZIP code of delivery location.*delivery_port: Port of delivery, similar to pickup port.*delivery_state: State or region of delivery location.*total_quantity: Overall quantity of shipped items (e.g., pieces, boxes). Calculate the total_quantity by summing the quantity of all packages.*total_weight: Total weight of the shipment (e.g., kg, lbs). Calculate the total_weight by summing the weights of all packages.*total_volume: Total volume of the shipment (e.g., cubic meters, cubic feet). Calculate the total_volume by summing the volumes of all packages.*quantity: Individual Quantity of a specific item being shipped.*package_type: Individual Type of packaging used (e.g., pallets, cartons).*weight: Individual Weight of a specific package.*measures: Individual Dimensions or measurements of a package.*stackable: Indicates whether the shipment is stackable (True or False).*volume: Individual Volume of a specific package.*commodity: Type of goods or commodities being shipped.*company: Name of the email sending company, also the shipping company or carrier.*incoterms: Choose available options: EXW, FCA, FAS, FOB, CFR, CIF, CPT, CIP, DAP, DPU, DDP.For attributes with multiple values, such as measures, volume, weight, package_type, and quantity, provide each value separately in a JSON format.###Input:dubaiDear Team,;Please quote SEA option for below inquiry;POD :Jebel Ali .;estimated packing details;3300x950x1350 mm;3800x1700x1350 mm;1900x2000x1200 mm;1900x2000x1200 mm;2600x1300x1200 mm;3900x1100x1350 mm;820x780x950 mm;Total weight kg 5000 approx;Not stackable;Marrone Srl;via Rui, 5 - Loc. Prà dei Risi;I - 33080 Zoppola (PN);Warehouse: 08:00 – 12:00 / 13:00 – 16:30;Warehouse Handling + Free days w.e.f 01-01-2024;AED 250 + vat until 10 CBM - AED 350 + Vat 11 CBM on wards;Free time applicable - 7 days only for General cargo from DO readiness & No free time for HAZ CARGO, post which standard storage tariff will apply.;Important Notice;:Considering the ongoing circumstances, please be informed after booking confirmation the rates and schedules may undergo changes without advance notice.;Please also expect vessel delays and changes in transit time.;CSS will not be liable for any claims that arise due to this.;Deepak Unnikrishnan;Sr Sales Coordinator;Consolidated Shipping Service L.L.C.;Office: +971 4 883 1303 | Ext: 1163| Toll Free: 800277 | Mobile: +971501513697|;Dubai | United Arab Emirates;nvo-import5@cssdubai.com | www.cssgroupsite.com;Our Offices: Dubai | Abu Dhabi | Sharjah | Ras-Al-Khaimah | Bahrain | Oman | Qatar | Saudi Arabia | Kuwait | Iraq | Africa | Turkiye | India | Sri Lanka |;Disclaimer: This email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please delete all copies and notify the sender immediately.;Please read our;disclaimer.###Response:''']]
|
36 |
|
37 |
# Create Gradio inputs with dropdown options for model selection
|
38 |
model_options = ["DataIntelligenceTeam/model-NER-Phi", "DataIntelligenceTeam/model-NER-Phi"]
|
@@ -53,7 +52,7 @@ iface = gr.Interface(
|
|
53 |
fn=generate_output,
|
54 |
inputs=inputs,
|
55 |
outputs="text",
|
56 |
-
examples=examples,
|
57 |
title="Information Extraction with Open-Source LLM",
|
58 |
description="Generate Information Extraction with OpenLLM.",
|
59 |
debug=True
|
|
|
31 |
return result[0]['generated_text']
|
32 |
|
33 |
|
34 |
+
examples = [['''Your task is to extract the information corresponding to the provided labels from the below given email.###Instruction:*pickup_location: Street address of the origin location of goods.*pickup_cap: Postal code or ZIP code of the pickup location.*pickup_port: Port of pickup, often used in international shipping.*pickup_state: Only Country of pickup location.*delivery_location: Street address of the destination location of goods.*delivery_cap: Postal code or ZIP code of delivery location.*delivery_port: Port of delivery, similar to pickup port.*delivery_state: State or region of delivery location.*total_quantity: Overall quantity of shipped items (e.g., pieces, boxes). Calculate the total_quantity by summing the quantity of all packages.*total_weight: Total weight of the shipment (e.g., kg, lbs). Calculate the total_weight by summing the weights of all packages.*total_volume: Total volume of the shipment (e.g., cubic meters, cubic feet). Calculate the total_volume by summing the volumes of all packages.*quantity: Individual Quantity of a specific item being shipped.*package_type: Individual Type of packaging used (e.g., pallets, cartons).*weight: Individual Weight of a specific package.*measures: Individual Dimensions or measurements of a package.*stackable: Indicates whether the shipment is stackable (True or False).*volume: Individual Volume of a specific package.*commodity: Type of goods or commodities being shipped.*company: Name of the email sending company, also the shipping company or carrier.*incoterms: Choose available options: EXW, FCA, FAS, FOB, CFR, CIF, CPT, CIP, DAP, DPU, DDP.For attributes with multiple values, such as measures, volume, weight, package_type, and quantity, provide each value separately in a JSON format.###Input:dubaiDear Team,;Please quote SEA option for below inquiry;POD :Jebel Ali .;estimated packing details;3300x950x1350 mm;3800x1700x1350 mm;1900x2000x1200 mm;1900x2000x1200 mm;2600x1300x1200 mm;3900x1100x1350 mm;820x780x950 mm;Total weight kg 5000 approx;Not stackable;Marrone Srl;via Rui, 5 - Loc. Prà dei Risi;I - 33080 Zoppola (PN);Warehouse: 08:00 – 12:00 / 13:00 – 16:30;Warehouse Handling + Free days w.e.f 01-01-2024;AED 250 + vat until 10 CBM - AED 350 + Vat 11 CBM on wards;Free time applicable - 7 days only for General cargo from DO readiness & No free time for HAZ CARGO, post which standard storage tariff will apply.;Important Notice;:Considering the ongoing circumstances, please be informed after booking confirmation the rates and schedules may undergo changes without advance notice.;Please also expect vessel delays and changes in transit time.;CSS will not be liable for any claims that arise due to this.;Deepak Unnikrishnan;Sr Sales Coordinator;Consolidated Shipping Service L.L.C.;Office: +971 4 883 1303 | Ext: 1163| Toll Free: 800277 | Mobile: +971501513697|;Dubai | United Arab Emirates;nvo-import5@cssdubai.com | www.cssgroupsite.com;Our Offices: Dubai | Abu Dhabi | Sharjah | Ras-Al-Khaimah | Bahrain | Oman | Qatar | Saudi Arabia | Kuwait | Iraq | Africa | Turkiye | India | Sri Lanka |;Disclaimer: This email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please delete all copies and notify the sender immediately.;Please read our;disclaimer.###Response:''']]
|
|
|
35 |
|
36 |
# Create Gradio inputs with dropdown options for model selection
|
37 |
model_options = ["DataIntelligenceTeam/model-NER-Phi", "DataIntelligenceTeam/model-NER-Phi"]
|
|
|
52 |
fn=generate_output,
|
53 |
inputs=inputs,
|
54 |
outputs="text",
|
55 |
+
#examples=examples,
|
56 |
title="Information Extraction with Open-Source LLM",
|
57 |
description="Generate Information Extraction with OpenLLM.",
|
58 |
debug=True
|