Skip to content

Instantly share code, notes, and snippets.

View fsndzomga's full-sized avatar

Franck Stéphane Ndzomga fsndzomga

View GitHub Profile
from ludwig.api import LudwigModel
import pandas
df = pandas.read_csv('rotten_tomatoes.csv')
model = LudwigModel(config='rotten_tomatoes.yaml')
results = model.train(dataset=df)
input_features:
- name: genres
type: set
preprocessing:
tokenizer: comma
- name: content_rating
type: category
- name: top_critic
type: binary
- name: runtime
input_features:
- name: genres
type: set
- name: content_rating
type: category
- name: top_critic
type: binary
- name: runtime
type: number
- name: review_content
@fsndzomga
fsndzomga / model.yaml
Created October 30, 2023 16:12
finetuning llama2-7b
model_type: llm
base_model: meta-llama/Llama-2-7b-hf
quantization:
bits: 4
adapter:
type: lora
prompt:
@fsndzomga
fsndzomga / backend.py
Created November 7, 2023 03:40
Backend AI Financial Analyst
import os
import requests
import json
from apiKey import apikey
from apiKey import serpapi
import yfinance as yf
from yahooquery import Ticker
import openai
os.environ["SERPAPI_API_KEY"] = serpapi
@fsndzomga
fsndzomga / frontend.py
Created November 7, 2023 03:42
frontend AI financial analyst
import streamlit as st
import matplotlib.pyplot as plt
from financial_analyst import financial_analyst
def main():
st.title("AI Financial Analyst App")
company_name = st.text_input("Company name:")
analyze_button = st.button("Analyze")
require 'nokogiri'
require 'selenium-webdriver'
require 'webdrivers'
require 'yaml'
require 'json'
chromedriver_path = '/Users/fsndzomga/Downloads/chromedriver-mac-arm64/chromedriver'
Selenium::WebDriver::Chrome::Service.driver_path = chromedriver_path
require 'dotenv'
require 'ruby/openai'
Dotenv.load
class IdeaGeneratorService
def initialize(industry, location)
@industry = industry
@location = location
end
class WebApp:
def __init__(self):
self.data = {}
def fetch_data(self, url):
# code to fetch data from a URL
self.data = {"example": "data"}
def process_data(self):
# code to process data
class DataFetcher:
def fetch_data(self, url):
# code to fetch data from a URL
return {"example": "data"}
class DataProcessor:
def process_data(self, data):
# code to process data
return {k: v.upper() for k, v in data.items()}