Skip to content

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
yiyiyi0817 committed Nov 18, 2024
1 parent b74ab07 commit acd0ee0
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,12 @@ To import your own user and post data, please refer to the JSON file format loca
```bash
# For Reddit
python scripts/reddit_gpt_example/reddit_simulation_gpt.py --config_path scripts/reddit_gpt_example/gpt_example.yaml

# For Twitter
python scripts/twitter_gpt_example/twitter_simulation_large.py --config_path scripts/twitter_gpt_example/gpt_example.yaml
```

Note: without modifying the Configuration File, running this script requires approximately 14 API requests to call gpt-4, and the cost incurred is minimal. (October 29, 2024)
Note: without modifying the Configuration File, running the reddit script requires approximately 14 API requests to call gpt-4, and the cost incurred is minimal. (October 29, 2024)

## 📘 Comprehensive Guide (For Open Source Models)

Expand Down
2 changes: 1 addition & 1 deletion oasis/social_agent/agents_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class instances.
model_type=model_type,
agent_graph=agent_graph,
action_space_prompt=action_space_prompt,
is_openai_model = is_openai_model,
is_openai_model=is_openai_model,
)

agent_graph.add_agent(agent)
Expand Down
5 changes: 3 additions & 2 deletions oasis/social_platform/recsys.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,8 +486,9 @@ def rec_sys_personalized_twh(
ActionType.LIKE_POST.value,
trace_table)
like_post_ids_all.append(like_post_ids)
# enable fans_score when the broadcasting effect of superuser should be taken in count
# ßscores = date_score_np * fans_score_np
# enable fans_score when the broadcasting effect of superuser should be
# taken in count
# ßscores = date_score_np * fans_score_np
scores = date_score_np
new_rec_matrix = []
if len(post_table) <= max_rec_post_len:
Expand Down
2 changes: 1 addition & 1 deletion scripts/twitter_gpt_example/gpt_example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ model:
temperature: null
inference:
model_type: gpt-4o-mini # Name of the OpenAI model
is_openai_model: true # Whether it is an OpenAI model
is_openai_model: true # Whether it is an OpenAI model
6 changes: 2 additions & 4 deletions scripts/twitter_gpt_example/twitter_simulation_large.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
from yaml import safe_load

from oasis.clock.clock import Clock
from oasis.inference.inference_manager import InferencerManager
from oasis.social_agent.agents_generator import generate_agents
from oasis.social_platform.channel import Channel
from oasis.social_platform.platform import Platform
Expand Down Expand Up @@ -179,9 +178,8 @@ async def running(
**simulation_params,
model_configs=model_configs,
inference_configs=inference_configs,
action_space_file_path=(
"scripts/twitter_gpt_example/"
"action_space_prompt.txt")))
action_space_file_path=("scripts/twitter_gpt_example/"
"action_space_prompt.txt")))
else:
asyncio.run(running())
social_log.info("Simulation finished.")

0 comments on commit acd0ee0

Please sign in to comment.