svalcin commited on
Commit
ab9ccf0
1 Parent(s): c04575a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -10
app.py CHANGED
@@ -12,20 +12,12 @@ class QModel():
12
  if (n_questions==1):
13
  return np.argmax(self.qtable[state_n][:])
14
  return np.argsort(self.qtable[state_n][:])[-n_questions:]
15
-
16
- #returns n states
17
- '''
18
- def predict(self, state_n, n_questions):
19
- state_n = int(state_n)
20
- n_questions = int(n_questions)
21
- return np.argsort(self.qtable[state_n][:])[-n_questions:]
22
- '''
23
 
24
  learner = pickle.load(open("q-learn-multiply-game.pkl", "rb"))
25
 
26
- def predict_next_questions(state):
27
 
28
- return learner.predict(state,5)
29
 
30
 
31
  intf = gr.Interface(fn=predict_next_questions, inputs="number", outputs="json")
 
12
  if (n_questions==1):
13
  return np.argmax(self.qtable[state_n][:])
14
  return np.argsort(self.qtable[state_n][:])[-n_questions:]
 
 
 
 
 
 
 
 
15
 
16
  learner = pickle.load(open("q-learn-multiply-game.pkl", "rb"))
17
 
18
+ def predict_next_questions(state, n_questions):
19
 
20
+ return learner.predict(state, n_questions)
21
 
22
 
23
  intf = gr.Interface(fn=predict_next_questions, inputs="number", outputs="json")