joephofhuis commited on
Commit
95b4ac2
·
verified ·
1 Parent(s): 157dba2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -9,8 +9,7 @@ adapter_model = "nickjelicic/Llama-3.2-3B-Instruct-Collectivist"
9
  SYSTEM_PROMPT = """
10
  You are playing the role of a university student, who is conducting an assignment together with another student. The assignment should be conducted together, as a collaboration. Both parties should contribute equally to the outcome of the assignment. In your communication, you are playing the role of a person with collectivist cultural background. Collectivism should be incorporated in the communication style, as well as the content of the assignment. The definitions of collectivism are provided below:
11
 
12
- Definitions
13
-
14
  * Collectivism is a philosophy that emphasizes the connection between the individual and the community. Its overriding philosophy is based on the belief that a person's social identity and personality are largely molded by community relationships. People in collectivistic cultures are closely connected and promote harmony and unity within society as a whole. (Source: Wikipedia)
15
  * Collectivism focuses on increasing overall group functioning as a way to create more overall happiness. (Source: Trompenaars)
16
  * In collectivist cultures, the needs, values, and goals of the in-group take precedence over the needs, values, and goals of the individual. (Triandis, 1995).
@@ -46,7 +45,8 @@ def respond(message,history: list[tuple[str, str]]):
46
  messages.append({"role": "user", "content": message})
47
 
48
  generation_config = {
49
- 'temperature':0.7
 
50
  }
51
  res = pipe(messages,**generation_config)
52
  return res[0]['generated_text'][-1]['content']
@@ -55,7 +55,8 @@ def respond(message,history: list[tuple[str, str]]):
55
  chatbot = gr.Chatbot(show_copy_all_button=True)
56
  demo = gr.ChatInterface(
57
  respond,
58
- chatbot=chatbot
 
59
  )
60
 
61
  if __name__ == "__main__":
 
9
  SYSTEM_PROMPT = """
10
  You are playing the role of a university student, who is conducting an assignment together with another student. The assignment should be conducted together, as a collaboration. Both parties should contribute equally to the outcome of the assignment. In your communication, you are playing the role of a person with collectivist cultural background. Collectivism should be incorporated in the communication style, as well as the content of the assignment. The definitions of collectivism are provided below:
11
 
12
+ Definitions:
 
13
  * Collectivism is a philosophy that emphasizes the connection between the individual and the community. Its overriding philosophy is based on the belief that a person's social identity and personality are largely molded by community relationships. People in collectivistic cultures are closely connected and promote harmony and unity within society as a whole. (Source: Wikipedia)
14
  * Collectivism focuses on increasing overall group functioning as a way to create more overall happiness. (Source: Trompenaars)
15
  * In collectivist cultures, the needs, values, and goals of the in-group take precedence over the needs, values, and goals of the individual. (Triandis, 1995).
 
45
  messages.append({"role": "user", "content": message})
46
 
47
  generation_config = {
48
+ 'temperature':0.7,
49
+ 'max_new_tokens':2048
50
  }
51
  res = pipe(messages,**generation_config)
52
  return res[0]['generated_text'][-1]['content']
 
55
  chatbot = gr.Chatbot(show_copy_all_button=True)
56
  demo = gr.ChatInterface(
57
  respond,
58
+ chatbot=chatbot,
59
+ description="Please do not close the window with the assignment. When you have completed the assignment, please copy the chat interactions into the designated textbox."
60
  )
61
 
62
  if __name__ == "__main__":