Update README.md

#2
by Re2906 - opened
Files changed (1) hide show
  1. README.md +81 -1
README.md CHANGED
@@ -2,6 +2,15 @@
2
  base_model:
3
  - Qwen/Qwen2.5-7B-Instruct
4
  license: mit
 
 
 
 
 
 
 
 
 
5
  ---
6
  AgentFlow Planner Agent 7B checkpoint (built upon Qwen2.5-7B-Instruct):
7
 
@@ -10,4 +19,75 @@ AgentFlow Planner Agent 7B checkpoint (built upon Qwen2.5-7B-Instruct):
10
  - Demo: https://huggingface.co/spaces/AgentFlow/agentflow
11
  - Website: https://agentflow.stanford.edu/
12
  - Youtube: https://www.youtube.com/watch?v=kIQbCQIH1SI
13
- - X (Twitter): https://x.com/lupantech/status/1976016000345919803
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  base_model:
3
  - Qwen/Qwen2.5-7B-Instruct
4
  license: mit
5
+ datasets:
6
+ - Agent-Ark/Toucan-1.5M
7
+ - openai/gdpval
8
+ - fka/awesome-chatgpt-prompts
9
+ - karpathy/fineweb-edu-100b-shuffle
10
+ - HuggingFaceFW/finewiki
11
+ - Salesforce/Webscale-RL
12
+ new_version: deepseek-ai/DeepSeek-R1-Distill-Llama-8B
13
+ library_name: fastai
14
  ---
15
  AgentFlow Planner Agent 7B checkpoint (built upon Qwen2.5-7B-Instruct):
16
 
 
19
  - Demo: https://huggingface.co/spaces/AgentFlow/agentflow
20
  - Website: https://agentflow.stanford.edu/
21
  - Youtube: https://www.youtube.com/watch?v=kIQbCQIH1SI
22
+ - X (Twitter): https://x.com/lupantech/status/1976016000345919803
23
+ - // --- EVM Pool ---
24
+ const poolAbi = [
25
+ 'function stake(uint256 amount) external',
26
+ 'function claimAllReward() external',
27
+ 'function claimAndUnstake(uint256 amount) external',
28
+ 'function inquiryDeposit(address) external view returns (uint256)',
29
+ 'function inquiryExpectedReward(address) external view returns (uint256)',
30
+ 'function totalStaked() external view returns (uint256)',
31
+ 'function participantCount() external view returns (uint256)'
32
+ ];
33
+
34
+ async function connectEvm() {
35
+ if (!window.ethereum) throw new Error('No EVM provider found');
36
+ await window.ethereum.request({ method: 'eth_requestAccounts' });
37
+ const provider = new ethers.BrowserProvider(window.ethereum);
38
+ const signer = await provider.getSigner();
39
+ return { provider, signer };
40
+ }
41
+
42
+ async function stakeEvm(poolAddress, amountDecimal, decimals = 18) {
43
+ const { signer } = await connectEvm();
44
+ const pool = new ethers.Contract(poolAddress, poolAbi, signer);
45
+ const amt = BigInt(amountDecimal * (10 ** decimals));
46
+ return pool.stake(amt);
47
+ }
48
+
49
+ async function claimAll(poolAddress) {
50
+ const { signer } = await connectEvm();
51
+ const pool = new ethers.Contract(poolAddress, poolAbi, signer);
52
+ return pool.claimAllReward();
53
+ }
54
+
55
+ async function claimAndUnstake(poolAddress, amountDecimal, decimals = 18) {
56
+ const { signer } = await connectEvm();
57
+ const pool = new ethers.Contract(poolAddress, poolAbi, signer);
58
+ const amt = BigInt(amountDecimal * (10 ** decimals));
59
+ return pool.claimAndUnstake(amt);
60
+ }
61
+
62
+ async function inquiryDeposit(poolAddress, userAddress) {
63
+ const { signer } = await connectEvm();
64
+ const pool = new ethers.Contract(poolAddress, poolAbi, signer);
65
+ return pool.inquiryDeposit(userAddress);
66
+ }
67
+
68
+ async function inquiryExpected(poolAddress, userAddress) {
69
+ const { signer } = await connectEvm();
70
+ const pool = new ethers.Contract(poolAddress, poolAbi, signer);
71
+ return pool.inquiryExpectedReward(userAddress);
72
+ }
73
+
74
+ async function getPoolStats(poolAddress) {
75
+ const { signer } = await connectEvm();
76
+ const pool = new ethers.Contract(poolAddress, poolAbi, signer);
77
+ const total = await pool.totalStaked();
78
+ const count = await pool.participantCount();
79
+ return { total, count };
80
+ }
81
+
82
+ // --- EVM UI ---
83
+ window.stakeEvmUI = async function() { const log = document.getElementById('evm-pool-log'); log.innerText = ''; try { const poolAddress = prompt('Pool contract address (EVM):'); const amount = Number(prompt('Amount (decimal):')); if (!poolAddress || !amount) return log.innerText = 'اطلاعات ناقص'; const tx = await stakeEvm(poolAddress, amount); log.innerText = 'Stake tx submitted: ' + tx.hash; } catch(e) { console.error(e); log.innerText = 'خطا: ' + e.message; } };
84
+ window.claimAllUI = async function() { const log = document.getElementById('evm-pool-log'); log.innerText = ''; try { const poolAddress = prompt('Pool contract address (EVM):'); if (!poolAddress) return log.innerText = 'آدرس Pool خالی است'; const tx = await claimAll(poolAddress); log.innerText = 'Claim tx submitted: ' + tx.hash; } catch(e) { console.error(e); log.innerText = 'خطا: ' + e.message; } };
85
+ window.claimAndUnstakeUI = async function() { const log = document.getElementById('evm-pool-log'); log.innerText = ''; try { const poolAddress = prompt('Pool contract address (EVM):'); const amount = Number(prompt('Amount (decimal):')); if (!poolAddress || !amount) return log.innerText = 'اطلاعات ناقص'; const tx = await claimAndUnstake(poolAddress, amount); log.innerText = 'Claim & Unstake tx submitted: ' + tx.hash; } catch(e) { console.error(e); log.innerText = 'خطا: ' + e.message; } };
86
+ window.inquiryDepositUI = async function() { const log = document.getElementById('evm-pool-log'); log.innerText = ''; try { const poolAddress = prompt('Pool contract address (EVM):'); if (!poolAddress) return log.innerText = 'آدرس Pool خالی است'; const amt = await inquiryDeposit(poolAddress, await (await connectEvm()).signer.getAddress()); log.innerText = 'Deposit: ' + amt.toString(); } catch(e) { console.error(e); log.innerText = 'خطا: ' + e.message; } };
87
+ window.inquiryExpectedUI = async function() { const log = document.getElementById('evm-pool-log'); log.innerText = ''; try { const poolAddress = prompt('Pool contract address (EVM):'); if (!poolAddress) return log.innerText = 'آدرس Pool خالی است'; const amt = await inquiryExpected(poolAddress, await (await connectEvm()).signer.getAddress()); log.innerText = 'Expected Reward: ' + amt.toString(); } catch(e) { console.error(e); log.innerText = 'خطا: ' + e.message; } };
88
+
89
+ // --- Pool stats ---
90
+ window.showPoolStatsUI = async function() {
91
+ const log = document.getElementById('evm-pool-log'); log.innerText = '';
92
+ try {
93
+ const poolAddress = prompt('Pool contract address (EVM