JerryLiJinyi commited on
Commit
35345c8
1 Parent(s): b5fca0e

Update scrl_compressor.py

Browse files
Files changed (1) hide show
  1. scrl_compressor.py +0 -17
scrl_compressor.py CHANGED
@@ -46,20 +46,3 @@ class SCRLCompressor(AbstractCompressor):
46
  }
47
  return result
48
 
49
-
50
- if __name__ == '__main__':
51
- import time
52
-
53
- compressor = SCRLCompressor(model_dir="../../models/newsroom-P75/", device="cuda", tokenizer_dir="/home/hdd/lijinyi/CompressionInAvalon/src/models/sentence-transformers/paraphrase-distilroberta-base-v2")
54
- # model_dir = "../../models/newsroom-P75/"
55
- # model_dir = "../../models/gigaword-L8/"
56
- # model_dir = "../../models/newsroom-L11/"
57
-
58
- # test_prompt = "You belong to good side. In reveal phase, You can know which two players are Morgana and Assassin but you can't know which one is Morgana or Assassin specifically, you should reason it by yourself as the game progresses."
59
- # test_prompt = "You are an Avalon gamer and you are playing a 6-player Avalon game. \nThis game is based on text conversations. Here are the game rules: \n\nRoles: The moderator is also the host, he organized this game and you need to answer his instructions correctly. Don’t talk with the moderator. There are five roles in the game, Merlin, Percival, Loyal Servant, Morgana, Assassin. Merlin, Percival and Loyal Servant belong to the good side and Morgana and Assassin belong to the evil side. \n\nRules: There are two alternate phases in this game, reveal phase and quest phase. \nWhen it’s the reveal phase: You need to follow the instructions of the moderator. You needn’t worry about other players and the moderator knowing what you say and do. No need to worry about suspicions from others during the phase. If you are Merlin, you can know which two players are Morgana and Assassin but you can't know which one is Morgana or Assassin specifically. If you are Percival, you can know which two players are Merlin and Morgana but you can't know which one is Morgana or Merlin specifically. If you are Morgana, you can know which player is Assassin. If you are Assassin, you can know which player is Morgana. If you are a Loyal Servant, you can't get any information in this phase. The quest phase includes 5 rounds. A round includes discussion, voting and engaging in the quest. At each round, all players need to discuss which players will engage in the quest at the current round (the players are also called candidates). And then all players need to vote if the candidates should engage in the quest, if the agreement exceeds 1/2, the candidates will engage in the quest, otherwise, discuss again and vote again. When engaging in the quest, the candidates need to choose to make the quest successful or failed. If all candidates choose to make the quest successful, The quest will succeed. If anyone makes the quest fail, the quest will fail. At the end of a round, if the quest succeeds, the good side will get one point, otherwise, the evil side will get one point. Which side scores 3 points first will win the game. If you are Assassin, at the end of a turn, you can choose to identify which one is Merlin. If the identifying is successful, the evil side directly wins the game. If not successful, the Assassin will expose his identification. \n\nObjectives: your goal is to help your camp get 3 points and win the game. If you are Assassin, you also need to reason which player is Merlin as early as possible. Only give the player’s name when making a decision/voting, and don’t generate other players’ conversation. Reasoning based on facts you have observed and you cannot perceive information (such as acoustic info) other than text. You’re playing with 5 other players. Do not pretend you are other players or the moderator.\n\nYou are player 1, the Morgana. Your playing style is that None.\n"
60
- test_prompt = ""
61
- start = time.time()
62
- result = compressor.compress(original_prompt=test_prompt)
63
- end = time.time()
64
- print(result)
65
- print('程序运行时间为: %s Seconds' % (end - start))
 
46
  }
47
  return result
48