File tree 1 file changed +20
-1
lines changed
1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,25 @@ async def query_capacity_to_miners(self, available_uids):
32
32
if isinstance (resp , Exception ):
33
33
bt .logging .error (f"exception happens while querying capacity to miner { uid } , { resp } " )
34
34
else :
35
- uid_to_capacity [uid ] = resp .bandwidth_rpm
35
+ uid_to_capacity [uid ] = self . validate_capacity ( resp .bandwidth_rpm )
36
36
self .uid_to_capacity = deepcopy (uid_to_capacity )
37
37
return uid_to_capacity
38
+
39
+ def validate_capacity (self , bandwidth ):
40
+ try :
41
+ open_ai_cap = bandwidth .get ("OpenAI" ).get ("gpt-4o" )
42
+ anthropic_cap = bandwidth .get ("Anthropic" ).get ("claude-3-5-sonnet-20240620" )
43
+ groq_cap = bandwidth .get ("Groq" ).get ("llama-3.1-70b-versatile" )
44
+ return {
45
+ "OpenAI" : {
46
+ "gpt-4o" : int (open_ai_cap )
47
+ },
48
+ "Anthropic" : {
49
+ "claude-3-5-sonnet-20240620" : int (anthropic_cap )
50
+ },
51
+ "Groq" : {
52
+ "llama-3.1-70b-versatile" : int (groq_cap )
53
+ }
54
+ }
55
+ except Exception as err :
56
+ return None
You can’t perform that action at this time.
0 commit comments