LecJackS commited on
Commit
f4fedaa
1 Parent(s): 3183b9a

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +12 -12
index.html CHANGED
@@ -9,31 +9,31 @@
9
  <body>
10
  <div class="card">
11
  <h1>Wolfram Alpha Tool for HuggingFace Agents</h1>
12
- <p>Not sure how to set this manually (push_to_hub does not seem to work for tool classes) so:</p>
13
- <p> Copy the contents of:<p>
14
- <a href="https://huggingface.co/spaces/LecJackS/wolfram-alpha-query/blob/main/wolfram-alpha-tool">https://huggingface.co/spaces/LecJackS/wolfram-alpha-query/blob/main/wolfram-alpha-tool</a>
15
-
16
  <h1>Usage instructions:</h1>
17
- <h3>Save WolframAlpha API key:</h3>
18
  <code>
19
- CFG_appid = WOLFRAM_API_KEY<br>
20
- <a href="https://products.wolframalpha.com/simple-api/documentation">https://products.wolframalpha.com/simple-api/documentation</a>
 
 
21
  </code>
22
 
23
  <h3>Test it:</h3>
24
  <code>
25
- query = "Integrate [ log(x)^2 + e^(x^2) dx ]"<br>
26
- wolframalpha_tool = WolframAlpha()<br>
27
  print(wolframalpha_tool(query))<br>
28
  </code>
29
 
30
  <h3>Add tool to agent:</h3>
31
- <code>
32
  agent = HfAgent("https://api-inference.huggingface.co/models/bigcode/starcoder", additional_tools=[wolframalpha_tool])
33
- </code>
34
  <h3>Ask the agent to solve some math:</h3>
35
  <code>
36
- res = agent.run("Solve the following equation: Area of circle of radius 2")<br>
37
  print(res)<br>
38
  <br>
39
  res = agent.run("Integrate log(x)^2 + e^(x^2) dx")<br>
 
9
  <body>
10
  <div class="card">
11
  <h1>Wolfram Alpha Tool for HuggingFace Agents</h1>
12
+ <h2>Demo Colab Notebook:</h2>
13
+
14
+ <a href="https://colab.research.google.com/drive/1wRv65uzfHO3WUJCo1tcRZgadq4XQ-o--">https://colab.research.google.com/drive/1wRv65uzfHO3WUJCo1tcRZgadq4XQ-o--</a><br>
 
15
  <h1>Usage instructions:</h1>
16
+ <h3>Create and save WolframAlpha APP_ID as an environment variable:</h3>
17
  <code>
18
+ os.environ["WOLFRAM_APP_ID"] = "YOUR_WOLFRAM_APP_ID"<br>
19
+ # Get it from: <a href="https://products.wolframalpha.com/simple-api/documentation">https://products.wolframalpha.com/simple-api/documentation</a><br>
20
+ from transformers import load_tool<br>
21
+ wolframalpha_tool = load_tool('LecJackS/wolfram-alpha-query')
22
  </code>
23
 
24
  <h3>Test it:</h3>
25
  <code>
26
+ query = "Integrate [ log(x)^2 + e^(x^2) dx ]"<br>
 
27
  print(wolframalpha_tool(query))<br>
28
  </code>
29
 
30
  <h3>Add tool to agent:</h3>
31
+ <code>
32
  agent = HfAgent("https://api-inference.huggingface.co/models/bigcode/starcoder", additional_tools=[wolframalpha_tool])
33
+ </code>
34
  <h3>Ask the agent to solve some math:</h3>
35
  <code>
36
+ res = agent.run("Solve the following equation: Area of circle of radius 2")<br>
37
  print(res)<br>
38
  <br>
39
  res = agent.run("Integrate log(x)^2 + e^(x^2) dx")<br>