diginoron commited on
Commit
b8e31be
·
verified ·
1 Parent(s): 9b14c83

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -48,12 +48,14 @@ def provide_advice(table_data: pd.DataFrame, hs_code: str, year: str, month: str
48
  print("پرامپت ساخته‌شده:")
49
  print(prompt)
50
  try:
51
- print("در حال فراخوانی مدل meta-llama/Llama-2-7b-chat...")
52
- outputs = client.text_generation(
53
- prompt=prompt,
54
- model="meta-llama/Llama-2-7b-chat", # مدل جدید
 
55
  max_new_tokens=1024
56
  )
 
57
  print("خروجی مدل دریافت شد (به انگلیسی):")
58
  print(outputs)
59
 
 
48
  print("پرامپت ساخته‌شده:")
49
  print(prompt)
50
  try:
51
+ print("در حال فراخوانی مدل google/gemma-2b-it با متد conversational...")
52
+ # استفاده از متد conversational
53
+ conversation = client.conversational(
54
+ text=prompt,
55
+ model="google/gemma-2b-it",
56
  max_new_tokens=1024
57
  )
58
+ outputs = conversation['generated_text'] if 'generated_text' in conversation else conversation
59
  print("خروجی مدل دریافت شد (به انگلیسی):")
60
  print(outputs)
61