asataura commited on
Commit
d1fe52d
·
1 Parent(s): af70321

Handling Signal

Browse files
Files changed (2) hide show
  1. app.py +9 -7
  2. trainer.py +1 -1
app.py CHANGED
@@ -30,17 +30,19 @@ def main():
30
 
31
  if start_button:
32
  agent = perform_training(jammer_type, channel_switching_cost)
 
 
 
 
 
 
 
 
33
  test(agent, jammer_type, channel_switching_cost)
34
 
 
35
  def perform_training(jammer_type, channel_switching_cost):
36
  agent = train(jammer_type, channel_switching_cost)
37
- st.subheader("Generating Insights of the DRL-Training")
38
- model_name = "tiiuae/falcon-7b-instruct"
39
- model = TFAutoModelForCausalLM.from_pretrained(model_name)
40
- tokenizer = TFAutoTokenizer.from_pretrained(model_name)
41
- pipeline = transformers.pipeline("text-generation", model=model, tokenizer=tokenizer, max_length=100, temperature=0.7)
42
- text = pipeline("Discuss this topic: Integrating LLMs to DRL-based anti-jamming.")
43
- st.write(text)
44
  return agent
45
 
46
 
 
30
 
31
  if start_button:
32
  agent = perform_training(jammer_type, channel_switching_cost)
33
+ st.subheader("Generating Insights of the DRL-Training")
34
+ model_name = "tiiuae/falcon-7b-instruct"
35
+ model = TFAutoModelForCausalLM.from_pretrained(model_name)
36
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
37
+ pipeline = transformers.pipeline("text-generation", model=model, tokenizer=tokenizer, max_length=100,
38
+ temperature=0.7)
39
+ text = pipeline("Discuss this topic: Integrating LLMs to DRL-based anti-jamming.")
40
+ st.write(text)
41
  test(agent, jammer_type, channel_switching_cost)
42
 
43
+
44
  def perform_training(jammer_type, channel_switching_cost):
45
  agent = train(jammer_type, channel_switching_cost)
 
 
 
 
 
 
 
46
  return agent
47
 
48
 
trainer.py CHANGED
@@ -21,7 +21,7 @@ def train(jammer_type, channel_switching_cost):
21
  s_size = ob_space.shape[0]
22
  a_size = ac_space.n
23
  max_env_steps = 100
24
- TRAIN_Episodes = 10
25
  env._max_episode_steps = max_env_steps
26
 
27
  epsilon = 1.0
 
21
  s_size = ob_space.shape[0]
22
  a_size = ac_space.n
23
  max_env_steps = 100
24
+ TRAIN_Episodes = 5
25
  env._max_episode_steps = max_env_steps
26
 
27
  epsilon = 1.0