kulia-moon commited on
Commit
36d0873
·
verified ·
1 Parent(s): 02a357c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -46,6 +46,7 @@ AVAILABLE_MODELS = {
46
  "nous-hermes": {"description": "Nous Hermes (fine-tune of Mistral)", "speed": "Fast"},
47
  "openchat": {"description": "OpenChat 3.5 (fine-tune of Mistral)", "speed": "Fast"},
48
  }
 
49
 
50
  # Diverse Names Dataset
51
  DIVERSE_NAMES = [
@@ -116,7 +117,7 @@ def chat(system, prompt, selected_model_name, seed=None, num_exchanges=5):
116
  follow_up_prompt_messages = [
117
  {"role": "system", "content": "You are a helpful and engaging assistant. Based on the last assistant response, generate a polite, open-ended, and cute follow-up question or statement from a user to keep a friendly conversation going. Make it relevant to the last message and consistent with a 'cute' and positive tone."},
118
  {"role": "assistant", "content": ai_response_content}, # Use the last AI response as context
119
- {"role": "user", "content": "Generate a cute and friendly follow-up question/statement (max 70 words)."}
120
  ]
121
 
122
  human_follow_up_obj = client.chat.completions.create(
@@ -306,7 +307,7 @@ def generate_and_display_conversations(num_conversations_input, custom_prompts_i
306
  # --- Auto-push main conversations to Hugging Face Dataset ---
307
  # Use the custom commit message
308
  commit_message = f"{commit_subject.strip()}\n\n{commit_body.strip()}" if commit_body.strip() else commit_subject.strip()
309
- push_status = push_file_to_huggingface_dataset(DATA_FILE, "conversations.jsonl", commit_message)
310
  generation_log.append(push_status)
311
  generation_log.append(f"Process complete at {datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')} (An Nhơn, Binh Dinh, Vietnam)")
312
 
@@ -664,8 +665,7 @@ with gr.Blocks() as demo:
664
  f"`{HF_DATASET_REPO_ID}` using a Hugging Face token securely stored as a Space Secret (`HF_TOKEN`). "
665
  "User tokens are not required."
666
  )
667
- current_datetime_vietnam = datetime.datetime.now(datetime.timezone(datetime.timedelta(hours=7))).strftime('%Y-%m-%d %H:%M:%S %Z%z')
668
- gr.Markdown(f"Current server time: {current_datetime_vietnam} (An Nhơn, Binh Dinh, Vietnam)")
669
 
670
 
671
  # Launch the Gradio app
 
46
  "nous-hermes": {"description": "Nous Hermes (fine-tune of Mistral)", "speed": "Fast"},
47
  "openchat": {"description": "OpenChat 3.5 (fine-tune of Mistral)", "speed": "Fast"},
48
  }
49
+ current_datetime_vietnam = datetime.datetime.now(datetime.timezone(datetime.timedelta(hours=7))).strftime('%Y-%m-%d %H:%M:%S %Z%z')
50
 
51
  # Diverse Names Dataset
52
  DIVERSE_NAMES = [
 
117
  follow_up_prompt_messages = [
118
  {"role": "system", "content": "You are a helpful and engaging assistant. Based on the last assistant response, generate a polite, open-ended, and cute follow-up question or statement from a user to keep a friendly conversation going. Make it relevant to the last message and consistent with a 'cute' and positive tone."},
119
  {"role": "assistant", "content": ai_response_content}, # Use the last AI response as context
120
+ {"role": "user", "content": "Generate friendly follow-up question/statement (max 700 words)."}
121
  ]
122
 
123
  human_follow_up_obj = client.chat.completions.create(
 
307
  # --- Auto-push main conversations to Hugging Face Dataset ---
308
  # Use the custom commit message
309
  commit_message = f"{commit_subject.strip()}\n\n{commit_body.strip()}" if commit_body.strip() else commit_subject.strip()
310
+ push_status = push_file_to_huggingface_dataset(DATA_FILE, f"data/conversations_{current_datetime_vietnam}.jsonl", commit_message)
311
  generation_log.append(push_status)
312
  generation_log.append(f"Process complete at {datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')} (An Nhơn, Binh Dinh, Vietnam)")
313
 
 
665
  f"`{HF_DATASET_REPO_ID}` using a Hugging Face token securely stored as a Space Secret (`HF_TOKEN`). "
666
  "User tokens are not required."
667
  )
668
+ gr.Markdown(f"Current server time: {current_datetime_vietnam} (An Nhơn, Binh Dinh, Vietnam)")
 
669
 
670
 
671
  # Launch the Gradio app