quocdat25 commited on
Commit
c7c19a5
1 Parent(s): 5880b6f

Upload folder using huggingface_hub

Browse files
.ipynb_checkpoints/chat_gradio-checkpoint.py CHANGED
@@ -20,7 +20,10 @@ def predict(message, history):
20
  # """))
21
 
22
  crypto_crew = CryptoCrew(message)
23
- response = "## Here is the Report\n\n" + crypto_crew.run()
 
 
 
24
 
25
  return response
26
 
 
20
  # """))
21
 
22
  crypto_crew = CryptoCrew(message)
23
+ response = crypto_crew.run(logging=True)
24
+ for i in range(len(message)):
25
+ time.sleep(0.05)
26
+ yield message[: i+1]
27
 
28
  return response
29
 
.ipynb_checkpoints/crew-checkpoint.py CHANGED
@@ -1,5 +1,6 @@
1
  from dotenv import load_dotenv, find_dotenv
2
  from textwrap import dedent
 
3
 
4
  load_dotenv(find_dotenv())
5
 
@@ -12,7 +13,7 @@ class CryptoCrew:
12
  def __init__(self, coin):
13
  self.coin = coin
14
 
15
- def run(self):
16
  agents = CryptoAnalysisAgents()
17
  tasks = CryptoAnalysisTasks()
18
 
@@ -34,8 +35,16 @@ class CryptoCrew:
34
  verbose=True
35
  )
36
 
37
- result = crew.kickoff()
 
 
 
 
 
 
 
38
  return result
 
39
 
40
  # if __name__ == "__main__":
41
  # print("## Welcome to Crypto Analysis Crew")
 
1
  from dotenv import load_dotenv, find_dotenv
2
  from textwrap import dedent
3
+ import io
4
 
5
  load_dotenv(find_dotenv())
6
 
 
13
  def __init__(self, coin):
14
  self.coin = coin
15
 
16
+ def run(self, logging=False):
17
  agents = CryptoAnalysisAgents()
18
  tasks = CryptoAnalysisTasks()
19
 
 
35
  verbose=True
36
  )
37
 
38
+ if logging:
39
+ f = io.StringIO()
40
+ with redirect_stdout(f):
41
+ result = crew.kickoff()
42
+ result = f.getvalue() + "## Here is the Report\n\n" + result
43
+ else:
44
+ result = crew.kickoff()
45
+
46
  return result
47
+
48
 
49
  # if __name__ == "__main__":
50
  # print("## Welcome to Crypto Analysis Crew")
chat_gradio.py CHANGED
@@ -20,7 +20,10 @@ def predict(message, history):
20
  # """))
21
 
22
  crypto_crew = CryptoCrew(message)
23
- response = "## Here is the Report\n\n" + crypto_crew.run()
 
 
 
24
 
25
  return response
26
 
 
20
  # """))
21
 
22
  crypto_crew = CryptoCrew(message)
23
+ response = crypto_crew.run(logging=True)
24
+ for i in range(len(message)):
25
+ time.sleep(0.05)
26
+ yield message[: i+1]
27
 
28
  return response
29
 
crew.py CHANGED
@@ -1,5 +1,6 @@
1
  from dotenv import load_dotenv, find_dotenv
2
  from textwrap import dedent
 
3
 
4
  load_dotenv(find_dotenv())
5
 
@@ -12,7 +13,7 @@ class CryptoCrew:
12
  def __init__(self, coin):
13
  self.coin = coin
14
 
15
- def run(self):
16
  agents = CryptoAnalysisAgents()
17
  tasks = CryptoAnalysisTasks()
18
 
@@ -34,8 +35,16 @@ class CryptoCrew:
34
  verbose=True
35
  )
36
 
37
- result = crew.kickoff()
 
 
 
 
 
 
 
38
  return result
 
39
 
40
  # if __name__ == "__main__":
41
  # print("## Welcome to Crypto Analysis Crew")
 
1
  from dotenv import load_dotenv, find_dotenv
2
  from textwrap import dedent
3
+ import io
4
 
5
  load_dotenv(find_dotenv())
6
 
 
13
  def __init__(self, coin):
14
  self.coin = coin
15
 
16
+ def run(self, logging=False):
17
  agents = CryptoAnalysisAgents()
18
  tasks = CryptoAnalysisTasks()
19
 
 
35
  verbose=True
36
  )
37
 
38
+ if logging:
39
+ f = io.StringIO()
40
+ with redirect_stdout(f):
41
+ result = crew.kickoff()
42
+ result = f.getvalue() + "## Here is the Report\n\n" + result
43
+ else:
44
+ result = crew.kickoff()
45
+
46
  return result
47
+
48
 
49
  # if __name__ == "__main__":
50
  # print("## Welcome to Crypto Analysis Crew")