pilgrim-65 commited on
Commit
c934a84
·
1 Parent(s): 655b11f

Added downloaded files

Browse files
.gitignore CHANGED
@@ -6,5 +6,3 @@
6
  .vscode/
7
  # Python
8
  __pycache__
9
- #files
10
- files/
 
6
  .vscode/
7
  # Python
8
  __pycache__
 
 
README.md CHANGED
@@ -6,6 +6,7 @@ colorTo: green
6
  sdk: gradio
7
  sdk_version: 5.47.0
8
  app_file: app.py
 
9
  pinned: false
10
  license: mit
11
  short_description: Final Assignment for agents course
 
6
  sdk: gradio
7
  sdk_version: 5.47.0
8
  app_file: app.py
9
+ hf_oauth: true
10
  pinned: false
11
  license: mit
12
  short_description: Final Assignment for agents course
files/7bd855d8-463d-4ed5-93ca-5fe35145f733.xlsx ADDED
Binary file (5.29 kB). View file
 
files/f918266a-b3e0-4914-865d-4faa564f1aef.py ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from random import randint
2
+ import time
3
+
4
+ class UhOh(Exception):
5
+ pass
6
+
7
+ class Hmm:
8
+ def __init__(self):
9
+ self.value = randint(-100, 100)
10
+
11
+ def Yeah(self):
12
+ if self.value == 0:
13
+ return True
14
+ else:
15
+ raise UhOh()
16
+
17
+ def Okay():
18
+ while True:
19
+ yield Hmm()
20
+
21
+ def keep_trying(go, first_try=True):
22
+ maybe = next(go)
23
+ try:
24
+ if maybe.Yeah():
25
+ return maybe.value
26
+ except UhOh:
27
+ if first_try:
28
+ print("Working...")
29
+ print("Please wait patiently...")
30
+ time.sleep(0.1)
31
+ return keep_trying(go, first_try=False)
32
+
33
+ if __name__ == "__main__":
34
+ go = Okay()
35
+ print(f"{keep_trying(go)}")