eagle0504 commited on
Commit
656d649
·
verified ·
1 Parent(s): e5a4f30

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -35
app.py CHANGED
@@ -4,37 +4,8 @@ import pandas as pd
4
  from together import Together
5
 
6
 
7
- client = Together(api_key=os.environ["TOGETHER_API_KEY"])
8
-
9
-
10
- def call_llama(prompt: str) -> str:
11
- """
12
- Send a prompt to the Llama model and return the response.
13
- Args:
14
- prompt (str): The input prompt to send to the Llama model.
15
-
16
- Returns:
17
- str: The response from the Llama model.
18
- """
19
-
20
- # Create a completion request with the prompt
21
- response = client.chat.completions.create(
22
-
23
- # Use the Llama-3-8b-chat-hf model
24
- model="meta-llama/Llama-3-8b-chat-hf",
25
-
26
- # Define the prompt as a user message
27
- messages=[
28
- {
29
- "role": "user",
30
- "content": prompt # Use the input prompt
31
- }
32
- ],
33
- temperature=0.7,
34
- )
35
-
36
- # Return the content of the first response message
37
- return response.choices[0].message.content
38
 
39
 
40
  with st.sidebar:
@@ -67,10 +38,6 @@ with st.sidebar:
67
  st.experimental_rerun()
68
 
69
 
70
- st.set_page_config(layout="wide")
71
- st.title("Duel Agent Simulation 🦙🦙")
72
-
73
-
74
  # Initialize chat history
75
  if "messages" not in st.session_state:
76
  st.session_state.messages = []
 
4
  from together import Together
5
 
6
 
7
+ st.set_page_config(layout="wide")
8
+ st.title("Duel Agent Simulation 🦙🦙")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
 
10
 
11
  with st.sidebar:
 
38
  st.experimental_rerun()
39
 
40
 
 
 
 
 
41
  # Initialize chat history
42
  if "messages" not in st.session_state:
43
  st.session_state.messages = []