diginoron commited on
Commit
27d5142
·
verified ·
1 Parent(s): c49bb4f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -34,15 +34,15 @@ def get_importers(hs_code: str, year: str, month: str):
34
  def provide_advice(table: pd.DataFrame, hs_code: str, year: str, month: str):
35
  if table is None or table.empty:
36
  return "ابتدا باید اطلاعات واردات را نمایش دهید."
37
- table_md = table.to_markdown(index=False)
38
  period = f"{year}/{int(month):02d}"
39
  prompt = (
40
  f"جدول زیر کشورهایی را نشان می‌دهد که کالا با کد HS {hs_code} را در دوره {period} وارد کرده‌اند:\n"
41
  f"{table_md}\n\n"
42
  "لطفاً بر اساس این اطلاعات دو پاراگراف مشاوره تخصصی بنویسید."
43
  )
44
- response = inference(prompt)
45
- return response
46
 
47
  current_year = pd.Timestamp.now().year
48
  years = [str(y) for y in range(2000, current_year+1)]
 
34
  def provide_advice(table: pd.DataFrame, hs_code: str, year: str, month: str):
35
  if table is None or table.empty:
36
  return "ابتدا باید اطلاعات واردات را نمایش دهید."
37
+ table_md = table.to_string(index=False)
38
  period = f"{year}/{int(month):02d}"
39
  prompt = (
40
  f"جدول زیر کشورهایی را نشان می‌دهد که کالا با کد HS {hs_code} را در دوره {period} وارد کرده‌اند:\n"
41
  f"{table_md}\n\n"
42
  "لطفاً بر اساس این اطلاعات دو پاراگراف مشاوره تخصصی بنویسید."
43
  )
44
+ raw = inference(prompt, raw_response=True)
45
+ return raw.text
46
 
47
  current_year = pd.Timestamp.now().year
48
  years = [str(y) for y in range(2000, current_year+1)]