Spaces:
Runtime error
Runtime error
CognitiveScience
commited on
Commit
•
e858f86
1
Parent(s):
fdebc5f
Update dcogsphere.py
Browse files- dcogsphere.py +27 -9
dcogsphere.py
CHANGED
@@ -1,3 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
from python_actr import *
|
2 |
log=log()
|
3 |
|
@@ -76,6 +87,13 @@ class RockPaperScissors(Model):
|
|
76 |
|
77 |
self.trials+=1
|
78 |
if self.trials>=100:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
log.score1=self.score1.text
|
80 |
log.score2=self.score2.text
|
81 |
self.stop()
|
@@ -92,12 +110,12 @@ class ProceduralPlayer(ACTR):
|
|
92 |
choice.choose('paper')
|
93 |
def play_scissors(goal='play rps',choice='waiting:True'):
|
94 |
choice.choose('scissors')
|
95 |
-
def logy():
|
96 |
-
env=RockPaperScissors()
|
97 |
-
env.model1=ProceduralPlayer()
|
98 |
-
env.model1.choice=env.choice1
|
99 |
-
env.model2=ProceduralPlayer()
|
100 |
-
env.model2.choice=env.choice2
|
101 |
-
response=env.run()
|
102 |
-
log_data = env.log
|
103 |
-
return log_data[0]['score1']
|
|
|
1 |
+
import huggingface_hub
|
2 |
+
import requests
|
3 |
+
from gradio_client import Client
|
4 |
+
client = Client("https://cogsphere-acogsphere.hf.space/")
|
5 |
+
#client = Client("https://cognitivescience-acogspherea.hf.space/--replicas/k5l86/")
|
6 |
+
#result = client.predict(
|
7 |
+
# fn_index=1
|
8 |
+
#)
|
9 |
+
#print(result)
|
10 |
+
|
11 |
+
|
12 |
from python_actr import *
|
13 |
log=log()
|
14 |
|
|
|
87 |
|
88 |
self.trials+=1
|
89 |
if self.trials>=100:
|
90 |
+
scora=self.score1.text
|
91 |
+
scorb=self.score2.text
|
92 |
+
result = client.predict(
|
93 |
+
scora,
|
94 |
+
"played",
|
95 |
+
scorb,
|
96 |
+
fn_index=0)
|
97 |
log.score1=self.score1.text
|
98 |
log.score2=self.score2.text
|
99 |
self.stop()
|
|
|
110 |
choice.choose('paper')
|
111 |
def play_scissors(goal='play rps',choice='waiting:True'):
|
112 |
choice.choose('scissors')
|
113 |
+
#def logy():
|
114 |
+
# env=RockPaperScissors()
|
115 |
+
# env.model1=ProceduralPlayer()
|
116 |
+
# env.model1.choice=env.choice1
|
117 |
+
# env.model2=ProceduralPlayer()
|
118 |
+
# env.model2.choice=env.choice2
|
119 |
+
# response=env.run()
|
120 |
+
# log_data = env.log
|
121 |
+
# return log_data[0]['score1']
|