avatarLaxfed Paulacy

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

1675

Abstract

/p><h2 id="b541">Starting with OpenAI</h2><p id="a6fb">The first approach involves using ChatGPT 3.5 from OpenAI with LangChain retrievalQA chain. This is a standard approach for building applications like this. Below is an example of a question answered by ChatGPT 3.5:</p><div id="dd96"><pre>from langchain import retrievalQA

<span class="hljs-attribute">question</span> <span class="hljs-operator">=</span> <span class="hljs-string">"What's covered in this earning call?"</span> <span class="hljs-attribute">response</span> <span class="hljs-operator">=</span> retrievalQA.answer(question) print(response)</pre></div><h2 id="ebf2">Using Vanilla Vicuna</h2><p id="bad0">Vicuna, an open-source chatbot trained by fine-tuning LLaMA on user-shared conversations collected from ShareGPT, was then explored. This involved working with LangChain, which is initially built upon OpenAI’s API, and switching to another model. Here’s how the environment variables can be altered to switch models:</p><div id="e0c9"><pre><span class="hljs-comment"># Switching to another model</span> import <span class="hljs-keyword">os</span>

<span class="hljs-keyword">os</span>.environ[<span class="hljs-string">"OPENAI_API_BASE"</span>] = <span class="hljs-string">"YOUR_DEPLOYMENT_URL"</span> <span class="hljs-keyword">os</span>.environ[<span class="hljs-string">"OPENAI_API_KEY"</span>] = <span class="hljs-string">"YOUR_LEPTON_AI_API_KEY"</span></pre></div><h2 id="6832">Fine Tuned Model</h2><p id="fd1b">Inspired by Vicuna, a fine-tuned model of llama was built. This involved collecting data from earning call transcripts and using TUNA, a model augmentation service, to create a model mo

Options

re focused on earning call context. Again, the only code change required was to alter the <code>OPENAI_API_BASE</code> variable:</p><div id="6300"><pre><span class="hljs-comment"># Altering the environment variables</span> <span class="hljs-keyword">os</span>.environ[<span class="hljs-string">"OPENAI_API_BASE"</span>] = <span class="hljs-string">"YOUR_DEPLOYMENT_URL"</span></pre></div><h2 id="0322">Conclusion</h2><p id="a4aa">The integration of data and LLM techniques is a pivotal milestone in the development of AI applications. By combining vast and diverse datasets with the power of LLM, we unlock unprecedented potential, enabling AI systems to generate more accurate, context-aware, and coherent outputs.</p><div id="10e1" class="link-block"> <a href="https://readmedium.com/can-you-interpret-code-using-an-api-282d6249a6d9"> <div> <div> <h2>LANGCHAIN — Can You Interpret Code Using an API?</h2> <div><h3>Talk is cheap. Show me the code. — Linus Torvalds</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*nu7ZXSdSXeo6aCLEJYoZpg.jpeg)"></div> </div> </div> </a> </div><p id="5bce">In conclusion, the code snippets and examples provided demonstrate how Lepton X LangChain can be used to transform AI into a savvy CFO. By leveraging the capabilities of language models and data integration, developers can create innovative AI applications that redefine what is possible in the field of AI.</p></article></body>

LANGCHAIN — Can Lepton X LangChain help you earn as a sage?

The human spirit must prevail over technology. — Albert Einstein

Lepton X LangChain: Transforming AI into a Savvy CFO

In this tutorial, we will explore how Lepton X LangChain can be used to transform AI into a savvy Chief Financial Officer (CFO). We will focus on the code and techniques used to achieve this, highlighting the integration of data and language model techniques.

The Problem Statement

The challenge is to organically combine the original earning call transcript, the text generation model (most likely OpenAI’s ChatGPT 3.5), and the toolset (Python, LangChain, Chroma) to mimic a CFO.

Starting with OpenAI

The first approach involves using ChatGPT 3.5 from OpenAI with LangChain retrievalQA chain. This is a standard approach for building applications like this. Below is an example of a question answered by ChatGPT 3.5:

from langchain import retrievalQA

question = "What's covered in this earning call?"
response = retrievalQA.answer(question)
print(response)

Using Vanilla Vicuna

Vicuna, an open-source chatbot trained by fine-tuning LLaMA on user-shared conversations collected from ShareGPT, was then explored. This involved working with LangChain, which is initially built upon OpenAI’s API, and switching to another model. Here’s how the environment variables can be altered to switch models:

# Switching to another model
import os

os.environ["OPENAI_API_BASE"] = "YOUR_DEPLOYMENT_URL"
os.environ["OPENAI_API_KEY"] = "YOUR_LEPTON_AI_API_KEY"

Fine Tuned Model

Inspired by Vicuna, a fine-tuned model of llama was built. This involved collecting data from earning call transcripts and using TUNA, a model augmentation service, to create a model more focused on earning call context. Again, the only code change required was to alter the OPENAI_API_BASE variable:

# Altering the environment variables
os.environ["OPENAI_API_BASE"] = "YOUR_DEPLOYMENT_URL"

Conclusion

The integration of data and LLM techniques is a pivotal milestone in the development of AI applications. By combining vast and diverse datasets with the power of LLM, we unlock unprecedented potential, enabling AI systems to generate more accurate, context-aware, and coherent outputs.

In conclusion, the code snippets and examples provided demonstrate how Lepton X LangChain can be used to transform AI into a savvy CFO. By leveraging the capabilities of language models and data integration, developers can create innovative AI applications that redefine what is possible in the field of AI.

Langchain
Earn
X
ChatGPT
Help
Recommended from ReadMedium